.. _file_include_reduce.hpp: File reduce.hpp =============== |exhale_lsh| :ref:`Parent directory ` (``include``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS Compile-time folds over ``HasStaticSize`` types. .. contents:: Contents :local: :backlinks: none Definition (``include/reduce.hpp``) ----------------------------------- .. toctree:: :maxdepth: 1 program_listing_file_include_reduce.hpp.rst 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==8); Works at compile time only; results are ``std::integral_constant`` or a value thereof. Includes -------- - ``htlist.hpp`` (:ref:`file_include_htlist.hpp`) - ``predicates.hpp`` (:ref:`file_include_predicates.hpp`) - ``type_traits`` Namespaces ---------- - :ref:`namespace_ctql` Typedefs -------- - :ref:`exhale_typedef_reduce_8hpp_1a31be6bb9f5bad4a475568bcd27c180fd` - :ref:`exhale_typedef_reduce_8hpp_1a9437db4ee3b2145a04b47c61e2880c41` Variables --------- - :ref:`exhale_variable_reduce_8hpp_1ab9131c047a1091768ec414c1f9ac70bc` - :ref:`exhale_variable_reduce_8hpp_1a051256625001aa3b8da2c9127c602206`