diff --git a/include/boost/container/detail/math_functions.hpp b/include/boost/container/detail/math_functions.hpp index e9a9165..af36896 100644 --- a/include/boost/container/detail/math_functions.hpp +++ b/include/boost/container/detail/math_functions.hpp @@ -167,6 +167,18 @@ struct lcm_ct BOOST_STATIC_CONSTEXPR std::size_t value = I1 * I2 / gcd_ct::value; }; +template +struct log2_pow2 +{ + BOOST_STATIC_CONSTEXPR std::size_t value = log2_pow2<(N >> 1), Count + 1>::value; +}; + +// Base case: we've reached 1 +template +struct log2_pow2<1, Count> { + BOOST_STATIC_CONSTEXPR std::size_t value = Count; +}; + } // namespace dtl } // namespace container } // namespace boost