diff options
Diffstat (limited to 'deps/tao_tuple/28626e99/include/tao/seq/min.hpp')
-rw-r--r-- | deps/tao_tuple/28626e99/include/tao/seq/min.hpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/deps/tao_tuple/28626e99/include/tao/seq/min.hpp b/deps/tao_tuple/28626e99/include/tao/seq/min.hpp new file mode 100644 index 0000000000..42bc6e1610 --- /dev/null +++ b/deps/tao_tuple/28626e99/include/tao/seq/min.hpp @@ -0,0 +1,33 @@ +// The Art of C++ / Sequences +// Copyright (c) 2015 Daniel Frey + +#ifndef TAOCPP_SEQUENCES_INCLUDE_MIN_HPP +#define TAOCPP_SEQUENCES_INCLUDE_MIN_HPP + +#include "fold.hpp" + +#include <type_traits> + +namespace tao +{ + namespace seq + { + namespace impl + { + template< typename T, T A, T B > + using min = std::integral_constant< T, ( ( A < B ) ? A : B ) >; + } + + template< typename T, T... Ns > + struct min + : fold< impl::min, T, Ns... > + {}; + + template< typename T, T... Ns > + struct min< integer_sequence< T, Ns... > > + : min< T, Ns... > + {}; + } +} + +#endif // TAOCPP_SEQUENCES_INCLUDE_MIN_HPP |