diff --git a/sprout/array.hpp b/sprout/array.hpp index 87d498b2..d1c29fc4 100644 --- a/sprout/array.hpp +++ b/sprout/array.hpp @@ -11,6 +11,7 @@ #include #include #include +#include #include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL #if SPROUT_USE_INDEX_ITERATOR_IMPLEMENTATION # include @@ -245,13 +246,17 @@ namespace sprout { // // make_array // - template - SPROUT_CONSTEXPR inline sprout::array make_array(T const& head, Tail const&... tail) { - return sprout::array{{head, tail...}}; + template + SPROUT_CONSTEXPR inline sprout::array make_array(Types&&... args) { + return sprout::array::type, sizeof...(Types)>{{sprout::forward(args)...}}; } - template - SPROUT_CONSTEXPR inline sprout::array make_array() { - return sprout::array{}; + + // + // make_common_array + // + template + SPROUT_CONSTEXPR inline sprout::array::type...>::type, sizeof...(Types)> make_common_array(Types&&... args) { + return sprout::array::type...>::type, sizeof...(Types)>{{sprout::forward(args)...}}; } namespace detail { diff --git a/sprout/math/factorial.hpp b/sprout/math/factorial.hpp index f86aee9d..ed2239e0 100644 --- a/sprout/math/factorial.hpp +++ b/sprout/math/factorial.hpp @@ -629,11 +629,18 @@ namespace sprout { SPROUT_CONSTEXPR typename sprout::math::detail::factorials::table_type sprout::math::detail::factorials::table; } // namespace detail // + // factorial_limit + // + template + SPROUT_CONSTEXPR std::size_t factorial_limit() { + return sprout::math::detail::factorials::limit; + } + // // factorial // template SPROUT_CONSTEXPR T factorial(std::size_t x) { - return x <= sprout::math::detail::factorials::limit + return x <= sprout::math::factorial_limit() ? sprout::math::detail::factorials::table[x] : throw std::invalid_argument("factorial(): argument limit exceeded") ;