-
-
Save picanumber/291e059221987c2b4d15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Max | |
{ | |
template <class T1, class T2> | |
constexpr decltype(auto) operator()(T1&& lhs, T2&& rhs) | |
{ | |
return lhs > rhs ? std::forward<T1>(lhs) : std::forward<T2>(rhs); | |
} | |
}; | |
int main() | |
{ | |
static_assert(20 == fld::foldl<Max>(1, 20, 3, 5), "ET phone home"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment