diff --git a/sprout/stateful/counter.hpp b/sprout/stateful/counter.hpp index 7734fea5..8af669b4 100644 --- a/sprout/stateful/counter.hpp +++ b/sprout/stateful/counter.hpp @@ -44,24 +44,24 @@ namespace sprout { }; template())> - SPROUT_CONSTEXPR bool check(int, sprout::counter_detail::tag) { + inline SPROUT_CONSTEXPR bool check(int, sprout::counter_detail::tag) { return true; } template - SPROUT_CONSTEXPR bool check(long, sprout::counter_detail::tag) { + inline SPROUT_CONSTEXPR bool check(long, sprout::counter_detail::tag) { return false; } template - SPROUT_CONSTEXPR bool check(bool R = sprout::counter_detail::check(0, sprout::counter_detail::tag())) { + inline SPROUT_CONSTEXPR bool check(bool R = sprout::counter_detail::check(0, sprout::counter_detail::tag())) { return R; } template - SPROUT_CONSTEXPR int counter(sprout::false_type, sprout::counter_detail::tag) { + inline SPROUT_CONSTEXPR int counter(sprout::false_type, sprout::counter_detail::tag) { return 0; } template - SPROUT_CONSTEXPR int counter( + inline SPROUT_CONSTEXPR int counter( sprout::true_type, sprout::counter_detail::tag, int R = !sprout::counter_detail::check() ? N : counter(sprout::bool_constant()>(), sprout::counter_detail::tag()) @@ -70,7 +70,7 @@ namespace sprout { return R; } template - SPROUT_CONSTEXPR int counter(int R = sprout::counter_detail::counter(sprout::true_type(), sprout::counter_detail::tag())) { + inline SPROUT_CONSTEXPR int counter(int R = sprout::counter_detail::counter(sprout::true_type(), sprout::counter_detail::tag())) { return R; } } // namespace counter_detail @@ -83,7 +83,7 @@ namespace sprout { sprout::counter_detail::counter() + N - 1 >::value > - SPROUT_CONSTEXPR int counter() { + inline SPROUT_CONSTEXPR int counter() { return R; } diff --git a/sprout/stateful/rand.hpp b/sprout/stateful/rand.hpp index cafe5283..467979dc 100644 --- a/sprout/stateful/rand.hpp +++ b/sprout/stateful/rand.hpp @@ -144,24 +144,24 @@ namespace sprout { SPROUT_CONSTEXPR_OR_CONST int sprout::rand_detail::state<0, IsSrand, Seed>::value; template())> - SPROUT_CONSTEXPR bool check(int, sprout::rand_detail::tag) { + inline SPROUT_CONSTEXPR bool check(int, sprout::rand_detail::tag) { return true; } template - SPROUT_CONSTEXPR bool check(long, sprout::rand_detail::tag) { + inline SPROUT_CONSTEXPR bool check(long, sprout::rand_detail::tag) { return false; } template - SPROUT_CONSTEXPR bool check(bool R = sprout::rand_detail::check(0, sprout::rand_detail::tag())) { + inline SPROUT_CONSTEXPR bool check(bool R = sprout::rand_detail::check(0, sprout::rand_detail::tag())) { return R; } template - SPROUT_CONSTEXPR int counter(sprout::false_type, sprout::rand_detail::tag) { + inline SPROUT_CONSTEXPR int counter(sprout::false_type, sprout::rand_detail::tag) { return 0; } template - SPROUT_CONSTEXPR int counter( + inline SPROUT_CONSTEXPR int counter( sprout::true_type, sprout::rand_detail::tag, int R = !sprout::rand_detail::check() ? N : counter(sprout::bool_constant()>(), sprout::rand_detail::tag()) @@ -170,7 +170,7 @@ namespace sprout { return R; } template - SPROUT_CONSTEXPR int counter(int R = sprout::rand_detail::counter(sprout::true_type(), sprout::rand_detail::tag())) { + inline SPROUT_CONSTEXPR int counter(int R = sprout::rand_detail::counter(sprout::true_type(), sprout::rand_detail::tag())) { return R; } } // namespace rand_detail @@ -183,7 +183,7 @@ namespace sprout { sprout::rand_detail::counter() + N - 1 >::value > - SPROUT_CONSTEXPR int rand() { + inline SPROUT_CONSTEXPR int rand() { return R; } @@ -208,7 +208,7 @@ namespace sprout { true, Seed >::value > - SPROUT_CONSTEXPR unsigned srand_return() { + inline SPROUT_CONSTEXPR unsigned srand_return() { return R; } diff --git a/sprout/stateful/typed_counter.hpp b/sprout/stateful/typed_counter.hpp index e1c8680f..9d9c3b81 100644 --- a/sprout/stateful/typed_counter.hpp +++ b/sprout/stateful/typed_counter.hpp @@ -87,7 +87,7 @@ namespace sprout { sprout::typed_counter_detail::typed::template counter(sprout::true_type(), typename sprout::typed_counter_detail::typed::template tag()) + N - 1 >::value > - SPROUT_CONSTEXPR int counter() { + inline SPROUT_CONSTEXPR int counter() { return R; } diff --git a/sprout/stateful/typed_rand.hpp b/sprout/stateful/typed_rand.hpp index 084ea77d..14c86ceb 100644 --- a/sprout/stateful/typed_rand.hpp +++ b/sprout/stateful/typed_rand.hpp @@ -178,7 +178,7 @@ namespace sprout { sprout::typed_rand_detail::typed::template counter(sprout::true_type(), typename sprout::typed_rand_detail::typed::template tag()) + N - 1 >::value > - SPROUT_CONSTEXPR int rand() { + inline SPROUT_CONSTEXPR int rand() { return R; } @@ -194,7 +194,7 @@ namespace sprout { true, Seed >::value > - SPROUT_CXX14_CONSTEXPR void srand() {} + inline SPROUT_CXX14_CONSTEXPR void srand() {} template< typename T, unsigned Seed, int N = 1, @@ -203,7 +203,7 @@ namespace sprout { true, Seed >::value > - SPROUT_CONSTEXPR unsigned srand_return() { + inline SPROUT_CONSTEXPR unsigned srand_return() { return R; } diff --git a/sprout/stateful/typed_slot.hpp b/sprout/stateful/typed_slot.hpp index 77c8f85b..32b4c9ce 100644 --- a/sprout/stateful/typed_slot.hpp +++ b/sprout/stateful/typed_slot.hpp @@ -108,7 +108,7 @@ namespace sprout { 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()) > - SPROUT_CONSTEXPR std::intmax_t slot() { + inline SPROUT_CONSTEXPR std::intmax_t slot() { return R; } @@ -124,7 +124,7 @@ namespace sprout { Value >::value > - SPROUT_CXX14_CONSTEXPR void assign_slot() {} + inline SPROUT_CXX14_CONSTEXPR void assign_slot() {} template< typename T, std::intmax_t Value, int N = 1, @@ -133,7 +133,7 @@ namespace sprout { Value >::value > - SPROUT_CONSTEXPR std::intmax_t assign_slot_return() { + inline SPROUT_CONSTEXPR std::intmax_t assign_slot_return() { return R; }