1 // The Art of C++ / Sequences 2 // Copyright (c) 2015 Daniel Frey 3 4 #ifndef TAOCPP_SEQUENCES_INCLUDE_IS_ALL_HPP 5 #define TAOCPP_SEQUENCES_INCLUDE_IS_ALL_HPP 6 7 #include "config.hpp" 8 9 #ifndef TAOCPP_FOLD_EXPRESSIONS 10 #include "integer_sequence.hpp" 11 #endif 12 13 #include <type_traits> 14 15 namespace tao 16 { 17 namespace seq 18 { 19 20 #ifdef TAOCPP_FOLD_EXPRESSIONS 21 22 template< bool... Bs > 23 using is_all = std::integral_constant< bool, ( Bs && ... ) >; 24 25 #else 26 27 template< bool... Bs > 28 using is_all = std::integral_constant< bool, std::is_same< integer_sequence< bool, true, Bs... >, integer_sequence< bool, Bs..., true > >::value >; 29 30 #endif 31 32 } 33 } 34 35 #endif // TAOCPP_SEQUENCES_INCLUDE_IS_ALL_HPP 36