mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-01-23 20:46:37 +00:00
add inline
This commit is contained in:
parent
8ee04c6048
commit
559db060ab
5 changed files with 22 additions and 22 deletions
|
@ -44,24 +44,24 @@ namespace sprout {
|
|||
};
|
||||
|
||||
template<int N, int = adl_counter(sprout::counter_detail::tag<N>())>
|
||||
SPROUT_CONSTEXPR bool check(int, sprout::counter_detail::tag<N>) {
|
||||
inline SPROUT_CONSTEXPR bool check(int, sprout::counter_detail::tag<N>) {
|
||||
return true;
|
||||
}
|
||||
template<int N>
|
||||
SPROUT_CONSTEXPR bool check(long, sprout::counter_detail::tag<N>) {
|
||||
inline SPROUT_CONSTEXPR bool check(long, sprout::counter_detail::tag<N>) {
|
||||
return false;
|
||||
}
|
||||
template<int N>
|
||||
SPROUT_CONSTEXPR bool check(bool R = sprout::counter_detail::check(0, sprout::counter_detail::tag<N>())) {
|
||||
inline SPROUT_CONSTEXPR bool check(bool R = sprout::counter_detail::check(0, sprout::counter_detail::tag<N>())) {
|
||||
return R;
|
||||
}
|
||||
|
||||
template<int N>
|
||||
SPROUT_CONSTEXPR int counter(sprout::false_type, sprout::counter_detail::tag<N>) {
|
||||
inline SPROUT_CONSTEXPR int counter(sprout::false_type, sprout::counter_detail::tag<N>) {
|
||||
return 0;
|
||||
}
|
||||
template<int N>
|
||||
SPROUT_CONSTEXPR int counter(
|
||||
inline SPROUT_CONSTEXPR int counter(
|
||||
sprout::true_type, sprout::counter_detail::tag<N>,
|
||||
int R = !sprout::counter_detail::check<N>() ? N
|
||||
: counter(sprout::bool_constant<sprout::counter_detail::check<N>()>(), sprout::counter_detail::tag<N + 1>())
|
||||
|
@ -70,7 +70,7 @@ namespace sprout {
|
|||
return R;
|
||||
}
|
||||
template<int N = 0>
|
||||
SPROUT_CONSTEXPR int counter(int R = sprout::counter_detail::counter(sprout::true_type(), sprout::counter_detail::tag<N>())) {
|
||||
inline SPROUT_CONSTEXPR int counter(int R = sprout::counter_detail::counter(sprout::true_type(), sprout::counter_detail::tag<N>())) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -144,24 +144,24 @@ namespace sprout {
|
|||
SPROUT_CONSTEXPR_OR_CONST int sprout::rand_detail::state<0, IsSrand, Seed>::value;
|
||||
|
||||
template<int N, int = adl_counter(sprout::rand_detail::tag<N>())>
|
||||
SPROUT_CONSTEXPR bool check(int, sprout::rand_detail::tag<N>) {
|
||||
inline SPROUT_CONSTEXPR bool check(int, sprout::rand_detail::tag<N>) {
|
||||
return true;
|
||||
}
|
||||
template<int N>
|
||||
SPROUT_CONSTEXPR bool check(long, sprout::rand_detail::tag<N>) {
|
||||
inline SPROUT_CONSTEXPR bool check(long, sprout::rand_detail::tag<N>) {
|
||||
return false;
|
||||
}
|
||||
template<int N>
|
||||
SPROUT_CONSTEXPR bool check(bool R = sprout::rand_detail::check(0, sprout::rand_detail::tag<N>())) {
|
||||
inline SPROUT_CONSTEXPR bool check(bool R = sprout::rand_detail::check(0, sprout::rand_detail::tag<N>())) {
|
||||
return R;
|
||||
}
|
||||
|
||||
template<int N>
|
||||
SPROUT_CONSTEXPR int counter(sprout::false_type, sprout::rand_detail::tag<N>) {
|
||||
inline SPROUT_CONSTEXPR int counter(sprout::false_type, sprout::rand_detail::tag<N>) {
|
||||
return 0;
|
||||
}
|
||||
template<int N>
|
||||
SPROUT_CONSTEXPR int counter(
|
||||
inline SPROUT_CONSTEXPR int counter(
|
||||
sprout::true_type, sprout::rand_detail::tag<N>,
|
||||
int R = !sprout::rand_detail::check<N>() ? N
|
||||
: counter(sprout::bool_constant<sprout::rand_detail::check<N>()>(), sprout::rand_detail::tag<N + 1>())
|
||||
|
@ -170,7 +170,7 @@ namespace sprout {
|
|||
return R;
|
||||
}
|
||||
template<int N = 0>
|
||||
SPROUT_CONSTEXPR int counter(int R = sprout::rand_detail::counter(sprout::true_type(), sprout::rand_detail::tag<N>())) {
|
||||
inline SPROUT_CONSTEXPR int counter(int R = sprout::rand_detail::counter(sprout::true_type(), sprout::rand_detail::tag<N>())) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ namespace sprout {
|
|||
sprout::typed_counter_detail::typed<T>::template counter(sprout::true_type(), typename sprout::typed_counter_detail::typed<T>::template tag<N - 1>()) + N - 1
|
||||
>::value
|
||||
>
|
||||
SPROUT_CONSTEXPR int counter() {
|
||||
inline SPROUT_CONSTEXPR int counter() {
|
||||
return R;
|
||||
}
|
||||
|
||||
|
|
|
@ -178,7 +178,7 @@ namespace sprout {
|
|||
sprout::typed_rand_detail::typed<T>::template counter(sprout::true_type(), typename sprout::typed_rand_detail::typed<T>::template tag<N - 1>()) + 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ namespace sprout {
|
|||
int N = 1,
|
||||
std::intmax_t R = sprout::typed_slot_detail::typed<T>::template val(sprout::true_type(), typename sprout::typed_slot_detail::typed<T>::template tag<N>())
|
||||
>
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue