File reduce.hpp
↰ Parent directory (include)
Compile-time folds over HasStaticSize types.
Definition (include/reduce.hpp)
Detailed Description
Folds a pack of types that expose a static size (via the HasStaticSize predicate) using a user-supplied binary meta-op on std::size_t. The public API is the {reduce_sizes_t, reduce_sizes_v} pair, plus Sum{,_v}. Complexity is linear in the number of types.
Example
structA{staticconstexprstd::size_tsize=3;}; structB{staticconstexprstd::size_tsize=5;}; static_assert(ctql::Sum_v<A,B>==8);
Works at compile time only; results are std::integral_constant<size_t, ...> or a value thereof.
Includes
htlist.hpp(File htlist.hpp)predicates.hpp(File predicates.hpp)type_traits