diff --git a/sprout/cstdlib/div.hpp b/sprout/cstdlib/div.hpp index e215f42c..f844369c 100644 --- a/sprout/cstdlib/div.hpp +++ b/sprout/cstdlib/div.hpp @@ -343,9 +343,7 @@ namespace sprout { namespace detail { template SPROUT_CONSTEXPR typename std::remove_reference().quot)>::type& - div_at(Div& d, std::size_t i) - SPROUT_NOEXCEPT_IF_EXPR(std::declval
().quot) - { + div_at(Div& d, std::size_t i) { return i == 0 ? d.quot : i == 1 ? d.rem : (throw std::out_of_range("div_at: index out of range"), d.quot) @@ -353,9 +351,7 @@ namespace sprout { } template SPROUT_CONSTEXPR typename std::remove_reference().quot)>::type const& - div_at(Div const& d, std::size_t i) - SPROUT_NOEXCEPT_IF_EXPR(std::declval
().quot) - { + div_at(Div const& d, std::size_t i) { return i == 0 ? d.quot : i == 1 ? d.rem : (throw std::out_of_range("div_at: index out of range"), d.quot) diff --git a/sprout/stateful/typed_counter.hpp b/sprout/stateful/typed_counter.hpp index 6729a211..c4bb7dca 100644 --- a/sprout/stateful/typed_counter.hpp +++ b/sprout/stateful/typed_counter.hpp @@ -84,7 +84,7 @@ namespace sprout { typename T, int N = 1, int R = sprout::typed_counter_detail::typed::template state< - sprout::typed_counter_detail::typed::template counter(sprout::true_type(), typename sprout::typed_counter_detail::typed::template tag()) + N - 1 + sprout::typed_counter_detail::typed::counter(sprout::true_type(), typename sprout::typed_counter_detail::typed::template tag()) + N - 1 >::value > inline SPROUT_CONSTEXPR int counter() { diff --git a/sprout/stateful/typed_rand.hpp b/sprout/stateful/typed_rand.hpp index 27aaae80..4702ef55 100644 --- a/sprout/stateful/typed_rand.hpp +++ b/sprout/stateful/typed_rand.hpp @@ -175,7 +175,7 @@ namespace sprout { typename T, int N = 1, int R = sprout::typed_rand_detail::typed::template state< - sprout::typed_rand_detail::typed::template counter(sprout::true_type(), typename sprout::typed_rand_detail::typed::template tag()) + N - 1 + sprout::typed_rand_detail::typed::counter(sprout::true_type(), typename sprout::typed_rand_detail::typed::template tag()) + N - 1 >::value > inline SPROUT_CONSTEXPR int rand() { @@ -190,7 +190,7 @@ namespace sprout { typename T, unsigned Seed, int N = 1, int = sprout::typed_rand_detail::typed::template state< - sprout::typed_rand_detail::typed::template counter(sprout::true_type(), typename sprout::typed_rand_detail::typed::template tag()) + N - 1, + sprout::typed_rand_detail::typed::counter(sprout::true_type(), typename sprout::typed_rand_detail::typed::template tag()) + N - 1, true, Seed >::value > @@ -199,7 +199,7 @@ namespace sprout { typename T, unsigned Seed, int N = 1, int R = sprout::typed_rand_detail::typed::template state< - sprout::typed_rand_detail::typed::template counter(sprout::true_type(), typename sprout::typed_rand_detail::typed::template tag()) + N - 1, + sprout::typed_rand_detail::typed::counter(sprout::true_type(), typename sprout::typed_rand_detail::typed::template tag()) + N - 1, true, Seed >::value > diff --git a/sprout/stateful/typed_slot.hpp b/sprout/stateful/typed_slot.hpp index 903a4ad8..ec5fcefa 100644 --- a/sprout/stateful/typed_slot.hpp +++ b/sprout/stateful/typed_slot.hpp @@ -106,7 +106,7 @@ namespace sprout { template< typename T, int N = 1, - std::intmax_t R = sprout::typed_slot_detail::typed::template val(sprout::true_type(), typename sprout::typed_slot_detail::typed::template tag()) + std::intmax_t R = sprout::typed_slot_detail::typed::val(sprout::true_type(), typename sprout::typed_slot_detail::typed::template tag()) > inline SPROUT_CONSTEXPR std::intmax_t slot() { return R; @@ -120,7 +120,7 @@ namespace sprout { typename T, std::intmax_t Value, int N = 1, std::intmax_t = sprout::typed_slot_detail::typed::template state< - sprout::typed_slot_detail::typed::template counter(sprout::true_type(), typename sprout::typed_slot_detail::typed::template tag()) + N - 1, + sprout::typed_slot_detail::typed::counter(sprout::true_type(), typename sprout::typed_slot_detail::typed::template tag()) + N - 1, Value >::value > @@ -129,7 +129,7 @@ namespace sprout { typename T, std::intmax_t Value, int N = 1, std::intmax_t R = sprout::typed_slot_detail::typed::template state< - sprout::typed_slot_detail::typed::template counter(sprout::true_type(), typename sprout::typed_slot_detail::typed::template tag()) + N - 1, + sprout::typed_slot_detail::typed::counter(sprout::true_type(), typename sprout::typed_slot_detail::typed::template tag()) + N - 1, Value >::value >