1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

fix for constexpr disabled

add sprout::adaptors::sized
This commit is contained in:
bolero-MURAKAMI 2012-06-16 00:08:42 +09:00
parent 2b8a8662af
commit bcd7674cc0
84 changed files with 1758 additions and 1365 deletions

View file

@ -184,7 +184,7 @@ namespace sprout {
}
};
template<typename T, std::size_t N>
SPROUT_CONSTEXPR typename sprout::array<T, N>::size_type sprout::array<T, N>::static_size;
SPROUT_CONSTEXPR_OR_CONST typename sprout::array<T, N>::size_type sprout::array<T, N>::static_size;
//
// operator==

View file

@ -19,8 +19,8 @@ namespace sprout {
struct div_t_traits2<INT_T> { \
public: \
typedef DIV_T type; \
static SPROUT_CONSTEXPR std::size_t offsetof_quot = offsetof(DIV_T, quot); \
static SPROUT_CONSTEXPR std::size_t offsetof_rem = offsetof(DIV_T, rem); \
SPROUT_STATIC_CONSTEXPR std::size_t offsetof_quot = offsetof(DIV_T, quot); \
SPROUT_STATIC_CONSTEXPR std::size_t offsetof_rem = offsetof(DIV_T, rem); \
}
SPROUT_DETAIL_DIV_T_TRAITS2_IMPL(std::intmax_t, std::imaxdiv_t);

View file

@ -11,10 +11,16 @@
# define SPROUT_CONSTEXPR constexpr
# define SPROUT_CONSTEXPR_OR_CONST constexpr
# define SPROUT_STATIC_CONSTEXPR static constexpr
#
# define SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(EXPR) = EXPR
# define SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(EXPR)
#else // #ifndef SPROUT_CONFIG_DISABLE_CONSTEXPR
# define SPROUT_CONSTEXPR
# define SPROUT_CONSTEXPR_OR_CONST const
# define SPROUT_STATIC_CONSTEXPR static const
#
# define SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(EXPR)
# define SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(EXPR) = EXPR
#endif // #ifndef SPROUT_CONFIG_DISABLE_CONSTEXPR
#ifndef SPROUT_CONFIG_DISABLE_NOEXCEPT

View file

@ -406,6 +406,9 @@ namespace sprout {
return static_size;
}
};
template<typename T, std::size_t N>
SPROUT_CONSTEXPR_OR_CONST typename sprout::detail::container_traits_default<T[N]>::size_type
sprout::detail::container_traits_default<T[N]>::static_size;
//
// container_traits_const_default

View file

@ -19,8 +19,8 @@ namespace sprout {
struct div_t_traits<INT_T> { \
public: \
typedef DIV_T type; \
static SPROUT_CONSTEXPR std::size_t offsetof_quot = offsetof(DIV_T, quot); \
static SPROUT_CONSTEXPR std::size_t offsetof_rem = offsetof(DIV_T, rem); \
SPROUT_STATIC_CONSTEXPR std::size_t offsetof_quot = offsetof(DIV_T, quot); \
SPROUT_STATIC_CONSTEXPR std::size_t offsetof_rem = offsetof(DIV_T, rem); \
}
SPROUT_DETAIL_DIV_T_TRAITS_IMPL(int, std::div_t);

View file

@ -88,7 +88,7 @@ namespace sprout {
field_flag(field_flag const&) = default;
};
template<sprout::io::flags::fmtflags Flag, sprout::io::flags::fmtflags Mask>
SPROUT_CONSTEXPR sprout::io::flags::fmtflags sprout::io::flags::field_flag<Flag, Mask>::mask;
SPROUT_CONSTEXPR_OR_CONST sprout::io::flags::fmtflags sprout::io::flags::field_flag<Flag, Mask>::mask;
//
// precision_t

View file

@ -142,13 +142,13 @@ namespace sprout {
}
bytes_iterator& operator+=(difference_type n) {
bytes_iterator temp(it_, i_ + n, ra_tag());
temp.swap(this);
return this;
temp.swap(*this);
return *this;
}
bytes_iterator& operator-=(difference_type n) {
bytes_iterator temp(it_, i_ - n, ra_tag());
temp.swap(this);
return this;
temp.swap(*this);
return *this;
}
SPROUT_CONSTEXPR reference operator[](difference_type n) const {
return *(*this + n);
@ -207,6 +207,19 @@ namespace sprout {
return it - n;
}
//
// distance
//
template<typename Iterator, typename Traits>
SPROUT_CONSTEXPR typename std::iterator_traits<sprout::bytes_iterator<Iterator, Traits> >::difference_type
distance(
sprout::bytes_iterator<Iterator, Traits> first,
sprout::bytes_iterator<Iterator, Traits> last
)
{
return last - first;
}
//
// make_bytes_iterator
//

View file

@ -25,8 +25,7 @@ namespace sprout {
void*
)
{
using std::next;
return next(sprout::forward<ForwardIterator>(it));
return std::next(sprout::forward<ForwardIterator>(it));
}
template<typename RandomAccessIterator>
@ -48,8 +47,7 @@ namespace sprout {
void*
)
{
using std::next;
return next(sprout::forward<ForwardIterator>(it), n);
return std::next(sprout::forward<ForwardIterator>(it), n);
}
} // namespace detail
//

View file

@ -25,8 +25,7 @@ namespace sprout {
void*
)
{
using std::prev;
return prev(sprout::forward<BidirectionalIterator>(it));
return std::prev(sprout::forward<BidirectionalIterator>(it));
}
template<typename RandomAccessIterator>
@ -48,8 +47,7 @@ namespace sprout {
void*
)
{
using std::prev;
return prev(sprout::forward<BidirectionalIterator>(it), n);
return std::prev(sprout::forward<BidirectionalIterator>(it), n);
}
} // namespace detail
//

View file

@ -10,6 +10,151 @@
namespace sprout {
namespace math {
namespace detail {
# define SPROUT_BERNOULLI_TABLE_DEF_FLOAT \
table_type{{ \
1.F, \
1.F / 6, \
-1.F / 30, \
1.F / 42, \
-1.F / 30, \
5.F / 66, \
-691.F / 2730, \
7.F / 6, \
-3617.F / 510, \
43867.F / 798, \
-174611.F / 330, \
854513.F / 138, \
-236364091.F / 2730, \
8553103.F / 6, \
-236364091.F / 870, \
8615841276005.F / 14322, \
-7709321041217.F / 510, \
2577687858367.F / 6, \
-26315271553053477373.F / 1919190, \
2929993913841559.F / 6, \
-261082718496449122051.F / 13530, \
1520097643918070802691.F / 1806, \
-2.783326957930102423502e22F / 690, \
5.96451111593912163278e23F / 282, \
-1.20866265222965259346e23F, \
7.500866746076964366856e24F, \
-5.038778101481068914138e26F, \
3.65287764848181233351e28F, \
-2.849876930245088222627e30F, \
2.386542749968362764465e32F, \
-2.139994925722533366581e34F, \
2.050097572347809756992e36F, \
-2.09380059113463784091e38F \
}}
# define SPROUT_BERNOULLI_TABLE_DEF_DOUBLE \
table_type{{ \
1., \
1. / 6, \
-1. / 30, \
1. / 42, \
-1. / 30, \
5. / 66, \
-691. / 2730, \
7. / 6, \
-3617. / 510, \
43867. / 798, \
-174611. / 330, \
854513. / 138, \
-236364091. / 2730, \
8553103. / 6, \
-236364091. / 870, \
8615841276005. / 14322, \
-7709321041217. / 510, \
2577687858367. / 6, \
-26315271553053477373. / 1919190, \
2929993913841559. / 6, \
-261082718496449122051. / 13530, \
1520097643918070802691. / 1806, \
-2.783326957930102423502e22 / 690, \
5.96451111593912163278e23 / 282, \
-1.20866265222965259346e23, \
7.500866746076964366856e24, \
-5.038778101481068914138e26, \
3.65287764848181233351e28, \
-2.849876930245088222627e30, \
2.386542749968362764465e32, \
-2.139994925722533366581e34, \
2.050097572347809756992e36, \
-2.09380059113463784091e38, \
2.275269648846351555965e40, \
-2.62577102862395760473e42, \
3.21250821027180325182e44, \
-4.159827816679471091392e46, \
5.692069548203528002388e48, \
-8.21836294197845756923e50, \
1.250290432716699301673e53, \
-2.001558323324837027493e55, \
3.36749829153643742334e57, \
-5.947097050313544771866e59, \
1.101191032362797755956e62, \
-2.135525954525350118866e64, \
4.332889698664119241962e66, \
-9.18855282416693282262e68 , \
2.034689677632907449346e71, \
-4.70038339580357310786e73, \
1.131804344548424927068e76, \
-2.838224957069370695926e78 \
}}
# define SPROUT_BERNOULLI_TABLE_DEF_LONG_DOUBLE \
table_type{{ \
1.L, \
1.L / 6, \
-1.L / 30, \
1.L / 42, \
-1.L / 30, \
5.L / 66, \
-691.L / 2730, \
7.L / 6, \
-3617.L / 510, \
43867.L / 798, \
-174611.L / 330, \
854513.L / 138, \
-236364091.L / 2730, \
8553103.L / 6, \
-236364091.L / 870, \
8615841276005.L / 14322, \
-7709321041217.L / 510, \
2577687858367.L / 6, \
-26315271553053477373.L / 1919190, \
2929993913841559.L / 6, \
-261082718496449122051.L / 13530, \
1520097643918070802691.L / 1806, \
-2.783326957930102423502e22L / 690, \
5.96451111593912163278e23L / 282, \
-1.20866265222965259346e23L, \
7.500866746076964366856e24L, \
-5.038778101481068914138e26L, \
3.65287764848181233351e28L, \
-2.849876930245088222627e30L, \
2.386542749968362764465e32L, \
-2.139994925722533366581e34L, \
2.050097572347809756992e36L, \
-2.09380059113463784091e38L, \
2.275269648846351555965e40L, \
-2.62577102862395760473e42L, \
3.21250821027180325182e44L, \
-4.159827816679471091392e46L, \
5.692069548203528002388e48L, \
-8.21836294197845756923e50L, \
1.250290432716699301673e53L, \
-2.001558323324837027493e55L, \
3.36749829153643742334e57L, \
-5.947097050313544771866e59L, \
1.101191032362797755956e62L, \
-2.135525954525350118866e64L, \
4.332889698664119241962e66L, \
-9.18855282416693282262e68L, \
2.034689677632907449346e71L, \
-4.70038339580357310786e73L, \
1.131804344548424927068e76L, \
-2.838224957069370695926e78L \
}}
template<typename T>
struct bernoulli_numbers;
@ -22,47 +167,15 @@ namespace sprout {
public:
typedef sprout::array<type, limit / 2 + 1> table_type;
public:
SPROUT_STATIC_CONSTEXPR table_type table = table_type{{
1.F,
1.F / 6,
-1.F / 30,
1.F / 42,
-1.F / 30,
5.F / 66,
-691.F / 2730,
7.F / 6,
-3617.F / 510,
43867.F / 798,
-174611.F / 330,
854513.F / 138,
-236364091.F / 2730,
8553103.F / 6,
-236364091.F / 870,
8615841276005.F / 14322,
-7709321041217.F / 510,
2577687858367.F / 6,
-26315271553053477373.F / 1919190,
2929993913841559.F / 6,
-261082718496449122051.F / 13530,
1520097643918070802691.F / 1806,
-2.783326957930102423502e22F / 690,
5.96451111593912163278e23F / 282,
-1.20866265222965259346e23F,
7.500866746076964366856e24F,
-5.038778101481068914138e26F,
3.65287764848181233351e28F,
-2.849876930245088222627e30F,
2.386542749968362764465e32F,
-2.139994925722533366581e34F,
2.050097572347809756992e36F,
-2.09380059113463784091e38F
}};
SPROUT_STATIC_CONSTEXPR table_type table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(SPROUT_BERNOULLI_TABLE_DEF_FLOAT)
;
};
SPROUT_CONSTEXPR typename sprout::math::detail::bernoulli_numbers<
SPROUT_CONSTEXPR_OR_CONST typename sprout::math::detail::bernoulli_numbers<
float
>::table_type sprout::math::detail::bernoulli_numbers<
float
>::table;
>::table SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_BERNOULLI_TABLE_DEF_FLOAT);
template<>
struct bernoulli_numbers<double> {
@ -73,65 +186,15 @@ namespace sprout {
public:
typedef sprout::array<type, limit / 2 + 1> table_type;
public:
SPROUT_STATIC_CONSTEXPR table_type table = table_type{{
1.,
1. / 6,
-1. / 30,
1. / 42,
-1. / 30,
5. / 66,
-691. / 2730,
7. / 6,
-3617. / 510,
43867. / 798,
-174611. / 330,
854513. / 138,
-236364091. / 2730,
8553103. / 6,
-236364091. / 870,
8615841276005. / 14322,
-7709321041217. / 510,
2577687858367. / 6,
-26315271553053477373. / 1919190,
2929993913841559. / 6,
-261082718496449122051. / 13530,
1520097643918070802691. / 1806,
-2.783326957930102423502e22 / 690,
5.96451111593912163278e23 / 282,
-1.20866265222965259346e23,
7.500866746076964366856e24,
-5.038778101481068914138e26,
3.65287764848181233351e28,
-2.849876930245088222627e30,
2.386542749968362764465e32,
-2.139994925722533366581e34,
2.050097572347809756992e36,
-2.09380059113463784091e38,
2.275269648846351555965e40,
-2.62577102862395760473e42,
3.21250821027180325182e44,
-4.159827816679471091392e46,
5.692069548203528002388e48,
-8.21836294197845756923e50,
1.250290432716699301673e53,
-2.001558323324837027493e55,
3.36749829153643742334e57,
-5.947097050313544771866e59,
1.101191032362797755956e62,
-2.135525954525350118866e64,
4.332889698664119241962e66,
-9.18855282416693282262e68 ,
2.034689677632907449346e71,
-4.70038339580357310786e73,
1.131804344548424927068e76,
-2.838224957069370695926e78
}};
SPROUT_STATIC_CONSTEXPR table_type table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(SPROUT_BERNOULLI_TABLE_DEF_DOUBLE)
;
};
SPROUT_CONSTEXPR typename sprout::math::detail::bernoulli_numbers<
SPROUT_CONSTEXPR_OR_CONST typename sprout::math::detail::bernoulli_numbers<
double
>::table_type sprout::math::detail::bernoulli_numbers<
double
>::table;
>::table SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_BERNOULLI_TABLE_DEF_DOUBLE);
template<>
struct bernoulli_numbers<long double> {
@ -142,65 +205,19 @@ namespace sprout {
public:
typedef sprout::array<type, limit / 2 + 1> table_type;
public:
SPROUT_STATIC_CONSTEXPR table_type table = table_type{{
1.L,
1.L / 6,
-1.L / 30,
1.L / 42,
-1.L / 30,
5.L / 66,
-691.L / 2730,
7.L / 6,
-3617.L / 510,
43867.L / 798,
-174611.L / 330,
854513.L / 138,
-236364091.L / 2730,
8553103.L / 6,
-236364091.L / 870,
8615841276005.L / 14322,
-7709321041217.L / 510,
2577687858367.L / 6,
-26315271553053477373.L / 1919190,
2929993913841559.L / 6,
-261082718496449122051.L / 13530,
1520097643918070802691.L / 1806,
-2.783326957930102423502e22L / 690,
5.96451111593912163278e23L / 282,
-1.20866265222965259346e23L,
7.500866746076964366856e24L,
-5.038778101481068914138e26L,
3.65287764848181233351e28L,
-2.849876930245088222627e30L,
2.386542749968362764465e32L,
-2.139994925722533366581e34L,
2.050097572347809756992e36L,
-2.09380059113463784091e38L,
2.275269648846351555965e40L,
-2.62577102862395760473e42L,
3.21250821027180325182e44L,
-4.159827816679471091392e46L,
5.692069548203528002388e48L,
-8.21836294197845756923e50L,
1.250290432716699301673e53L,
-2.001558323324837027493e55L,
3.36749829153643742334e57L,
-5.947097050313544771866e59L,
1.101191032362797755956e62L,
-2.135525954525350118866e64L,
4.332889698664119241962e66L,
-9.18855282416693282262e68L,
2.034689677632907449346e71L,
-4.70038339580357310786e73L,
1.131804344548424927068e76L,
-2.838224957069370695926e78L
}};
SPROUT_STATIC_CONSTEXPR table_type table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(SPROUT_BERNOULLI_TABLE_DEF_LONG_DOUBLE)
;
};
SPROUT_CONSTEXPR typename sprout::math::detail::bernoulli_numbers<
SPROUT_CONSTEXPR_OR_CONST typename sprout::math::detail::bernoulli_numbers<
long double
>::table_type sprout::math::detail::bernoulli_numbers<
long double
>::table;
>::table SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_BERNOULLI_TABLE_DEF_LONG_DOUBLE);
# undef SPROUT_BERNOULLI_TABLE_DEF_FLOAT
# undef SPROUT_BERNOULLI_TABLE_DEF_DOUBLE
# undef SPROUT_BERNOULLI_TABLE_DEF_LONG_DOUBLE
} // namespace detail
//
// bernoulli_number_limit

File diff suppressed because it is too large Load diff

View file

@ -127,7 +127,7 @@ namespace sprout {
}
};
template<typename Container>
SPROUT_CONSTEXPR typename sprout::pit<Container>::size_type sprout::pit<Container>::static_size;
SPROUT_CONSTEXPR_OR_CONST typename sprout::pit<Container>::size_type sprout::pit<Container>::static_size;
//
// operator==

View file

@ -18,24 +18,32 @@
namespace sprout {
namespace random {
namespace detail {
# define SPROUT_BINOMIAL_TABLE_DEF \
table_type{{ \
1, \
1, \
2, \
6, \
24, \
120 \
}}
template<typename RealType>
struct binomial_table {
public:
SPROUT_STATIC_CONSTEXPR sprout::array<RealType, 10> table = sprout::array<RealType, 10>{{
0.08106146679532726,
0.04134069595540929,
0.02767792568499834,
0.02079067210376509,
0.01664469118982119,
0.01387612882307075,
0.01189670994589177,
0.01041126526197209,
0.009255462182712733,
0.008330563433362871
}};
public:
typedef sprout::array<RealType, 10> table_type;
public:
SPROUT_STATIC_CONSTEXPR table_type table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(SPROUT_BINOMIAL_TABLE_DEF)
;
};
template<class RealType>
SPROUT_CONSTEXPR sprout::array<RealType, 10> sprout::random::detail::binomial_table<RealType>::table;
SPROUT_CONSTEXPR_OR_CONST typename sprout::random::detail::binomial_table<RealType>::table_type
sprout::random::detail::binomial_table<RealType>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_BINOMIAL_TABLE_DEF)
;
# undef SPROUT_BINOMIAL_TABLE_DEF
} // namespace detail
//
// binomial_distribution

View file

@ -111,13 +111,13 @@ namespace sprout {
}
};
template<typename IntType, IntType a, IntType b, IntType p>
SPROUT_CONSTEXPR IntType sprout::random::inversive_congruential_engine<IntType, a, b, p>::multiplier;
SPROUT_CONSTEXPR_OR_CONST IntType sprout::random::inversive_congruential_engine<IntType, a, b, p>::multiplier;
template<typename IntType, IntType a, IntType b, IntType p>
SPROUT_CONSTEXPR IntType sprout::random::inversive_congruential_engine<IntType, a, b, p>::increment;
SPROUT_CONSTEXPR_OR_CONST IntType sprout::random::inversive_congruential_engine<IntType, a, b, p>::increment;
template<typename IntType, IntType a, IntType b, IntType p>
SPROUT_CONSTEXPR IntType sprout::random::inversive_congruential_engine<IntType, a, b, p>::modulus;
SPROUT_CONSTEXPR_OR_CONST IntType sprout::random::inversive_congruential_engine<IntType, a, b, p>::modulus;
template<typename IntType, IntType a, IntType b, IntType p>
SPROUT_CONSTEXPR IntType sprout::random::inversive_congruential_engine<IntType, a, b, p>::default_seed;
SPROUT_CONSTEXPR_OR_CONST IntType sprout::random::inversive_congruential_engine<IntType, a, b, p>::default_seed;
//
// hellekalek1995

View file

@ -114,13 +114,13 @@ namespace sprout {
}
};
template<typename IntType, IntType a, IntType c, IntType m>
SPROUT_CONSTEXPR IntType sprout::random::linear_congruential_engine<IntType, a, c, m>::multiplier;
SPROUT_CONSTEXPR_OR_CONST IntType sprout::random::linear_congruential_engine<IntType, a, c, m>::multiplier;
template<typename IntType, IntType a, IntType c, IntType m>
SPROUT_CONSTEXPR IntType sprout::random::linear_congruential_engine<IntType, a, c, m>::increment;
SPROUT_CONSTEXPR_OR_CONST IntType sprout::random::linear_congruential_engine<IntType, a, c, m>::increment;
template<typename IntType, IntType a, IntType c, IntType m>
SPROUT_CONSTEXPR IntType sprout::random::linear_congruential_engine<IntType, a, c, m>::modulus;
SPROUT_CONSTEXPR_OR_CONST IntType sprout::random::linear_congruential_engine<IntType, a, c, m>::modulus;
template<typename IntType, IntType a, IntType c, IntType m>
SPROUT_CONSTEXPR IntType sprout::random::linear_congruential_engine<IntType, a, c, m>::default_seed;
SPROUT_CONSTEXPR_OR_CONST IntType sprout::random::linear_congruential_engine<IntType, a, c, m>::default_seed;
//
// minstd_rand0

View file

@ -97,15 +97,15 @@ namespace sprout {
}
};
template<typename UIntType, int w, int k, int q, int s>
SPROUT_CONSTEXPR int sprout::random::linear_feedback_shift_engine<UIntType, w, k, q, s>::word_size;
SPROUT_CONSTEXPR_OR_CONST int sprout::random::linear_feedback_shift_engine<UIntType, w, k, q, s>::word_size;
template<typename UIntType, int w, int k, int q, int s>
SPROUT_CONSTEXPR int sprout::random::linear_feedback_shift_engine<UIntType, w, k, q, s>::exponent1;
SPROUT_CONSTEXPR_OR_CONST int sprout::random::linear_feedback_shift_engine<UIntType, w, k, q, s>::exponent1;
template<typename UIntType, int w, int k, int q, int s>
SPROUT_CONSTEXPR int sprout::random::linear_feedback_shift_engine<UIntType, w, k, q, s>::exponent2;
SPROUT_CONSTEXPR_OR_CONST int sprout::random::linear_feedback_shift_engine<UIntType, w, k, q, s>::exponent2;
template<typename UIntType, int w, int k, int q, int s>
SPROUT_CONSTEXPR int sprout::random::linear_feedback_shift_engine<UIntType, w, k, q, s>::step_size;
SPROUT_CONSTEXPR_OR_CONST int sprout::random::linear_feedback_shift_engine<UIntType, w, k, q, s>::step_size;
template<typename UIntType, int w, int k, int q, int s>
SPROUT_CONSTEXPR UIntType sprout::random::linear_feedback_shift_engine<UIntType, w, k, q, s>::default_seed;
SPROUT_CONSTEXPR_OR_CONST UIntType sprout::random::linear_feedback_shift_engine<UIntType, w, k, q, s>::default_seed;
} // namespace random
using sprout::random::linear_feedback_shift_engine;

View file

@ -372,33 +372,33 @@ namespace sprout {
}
};
template<typename UIntType, std::size_t w, std::size_t n, std::size_t m, std::size_t r, UIntType a, std::size_t u, UIntType d, std::size_t s, UIntType b, std::size_t t, UIntType c, std::size_t l, UIntType f>
SPROUT_CONSTEXPR std::size_t sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::word_size;
SPROUT_CONSTEXPR_OR_CONST std::size_t sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::word_size;
template<typename UIntType, std::size_t w, std::size_t n, std::size_t m, std::size_t r, UIntType a, std::size_t u, UIntType d, std::size_t s, UIntType b, std::size_t t, UIntType c, std::size_t l, UIntType f>
SPROUT_CONSTEXPR std::size_t sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::state_size;
SPROUT_CONSTEXPR_OR_CONST std::size_t sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::state_size;
template<typename UIntType, std::size_t w, std::size_t n, std::size_t m, std::size_t r, UIntType a, std::size_t u, UIntType d, std::size_t s, UIntType b, std::size_t t, UIntType c, std::size_t l, UIntType f>
SPROUT_CONSTEXPR std::size_t sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::shift_size;
SPROUT_CONSTEXPR_OR_CONST std::size_t sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::shift_size;
template<typename UIntType, std::size_t w, std::size_t n, std::size_t m, std::size_t r, UIntType a, std::size_t u, UIntType d, std::size_t s, UIntType b, std::size_t t, UIntType c, std::size_t l, UIntType f>
SPROUT_CONSTEXPR std::size_t sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::mask_bits;
SPROUT_CONSTEXPR_OR_CONST std::size_t sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::mask_bits;
template<typename UIntType, std::size_t w, std::size_t n, std::size_t m, std::size_t r, UIntType a, std::size_t u, UIntType d, std::size_t s, UIntType b, std::size_t t, UIntType c, std::size_t l, UIntType f>
SPROUT_CONSTEXPR UIntType sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::xor_mask;
SPROUT_CONSTEXPR_OR_CONST UIntType sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::xor_mask;
template<typename UIntType, std::size_t w, std::size_t n, std::size_t m, std::size_t r, UIntType a, std::size_t u, UIntType d, std::size_t s, UIntType b, std::size_t t, UIntType c, std::size_t l, UIntType f>
SPROUT_CONSTEXPR std::size_t sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::tempering_u;
SPROUT_CONSTEXPR_OR_CONST std::size_t sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::tempering_u;
template<typename UIntType, std::size_t w, std::size_t n, std::size_t m, std::size_t r, UIntType a, std::size_t u, UIntType d, std::size_t s, UIntType b, std::size_t t, UIntType c, std::size_t l, UIntType f>
SPROUT_CONSTEXPR UIntType sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::tempering_d;
SPROUT_CONSTEXPR_OR_CONST UIntType sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::tempering_d;
template<typename UIntType, std::size_t w, std::size_t n, std::size_t m, std::size_t r, UIntType a, std::size_t u, UIntType d, std::size_t s, UIntType b, std::size_t t, UIntType c, std::size_t l, UIntType f>
SPROUT_CONSTEXPR std::size_t sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::tempering_s;
SPROUT_CONSTEXPR_OR_CONST std::size_t sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::tempering_s;
template<typename UIntType, std::size_t w, std::size_t n, std::size_t m, std::size_t r, UIntType a, std::size_t u, UIntType d, std::size_t s, UIntType b, std::size_t t, UIntType c, std::size_t l, UIntType f>
SPROUT_CONSTEXPR UIntType sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::tempering_b;
SPROUT_CONSTEXPR_OR_CONST UIntType sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::tempering_b;
template<typename UIntType, std::size_t w, std::size_t n, std::size_t m, std::size_t r, UIntType a, std::size_t u, UIntType d, std::size_t s, UIntType b, std::size_t t, UIntType c, std::size_t l, UIntType f>
SPROUT_CONSTEXPR std::size_t sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::tempering_t;
SPROUT_CONSTEXPR_OR_CONST std::size_t sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::tempering_t;
template<typename UIntType, std::size_t w, std::size_t n, std::size_t m, std::size_t r, UIntType a, std::size_t u, UIntType d, std::size_t s, UIntType b, std::size_t t, UIntType c, std::size_t l, UIntType f>
SPROUT_CONSTEXPR UIntType sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::tempering_c;
SPROUT_CONSTEXPR_OR_CONST UIntType sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::tempering_c;
template<typename UIntType, std::size_t w, std::size_t n, std::size_t m, std::size_t r, UIntType a, std::size_t u, UIntType d, std::size_t s, UIntType b, std::size_t t, UIntType c, std::size_t l, UIntType f>
SPROUT_CONSTEXPR std::size_t sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::tempering_l;
SPROUT_CONSTEXPR_OR_CONST std::size_t sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::tempering_l;
template<typename UIntType, std::size_t w, std::size_t n, std::size_t m, std::size_t r, UIntType a, std::size_t u, UIntType d, std::size_t s, UIntType b, std::size_t t, UIntType c, std::size_t l, UIntType f>
SPROUT_CONSTEXPR UIntType sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::initialization_multiplier;
SPROUT_CONSTEXPR_OR_CONST UIntType sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::initialization_multiplier;
template<typename UIntType, std::size_t w, std::size_t n, std::size_t m, std::size_t r, UIntType a, std::size_t u, UIntType d, std::size_t s, UIntType b, std::size_t t, UIntType c, std::size_t l, UIntType f>
SPROUT_CONSTEXPR UIntType sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::default_seed;
SPROUT_CONSTEXPR_OR_CONST UIntType sprout::random::mersenne_twister_engine<UIntType, w, n, m, r, a, u, d, s, b, t, c, l, f>::default_seed;
//
// mt11213b

View file

@ -164,9 +164,9 @@ namespace sprout {
}
};
template<typename UniformRandomNumberGenerator, std::size_t k>
SPROUT_CONSTEXPR std::size_t sprout::random::shuffle_order_engine<UniformRandomNumberGenerator, k>::buffer_size;
SPROUT_CONSTEXPR_OR_CONST std::size_t sprout::random::shuffle_order_engine<UniformRandomNumberGenerator, k>::buffer_size;
template<typename UniformRandomNumberGenerator, std::size_t k>
SPROUT_CONSTEXPR std::size_t sprout::random::shuffle_order_engine<UniformRandomNumberGenerator, k>::table_size;
SPROUT_CONSTEXPR_OR_CONST std::size_t sprout::random::shuffle_order_engine<UniformRandomNumberGenerator, k>::table_size;
//
// knuth_b

View file

@ -81,9 +81,9 @@ namespace sprout {
}
};
template<typename URNG1, int s1, typename URNG2, int s2>
SPROUT_CONSTEXPR int sprout::random::xor_combine_engine<URNG1, s1, URNG2, s2>::shift1;
SPROUT_CONSTEXPR_OR_CONST int sprout::random::xor_combine_engine<URNG1, s1, URNG2, s2>::shift1;
template<typename URNG1, int s1, typename URNG2, int s2>
SPROUT_CONSTEXPR int sprout::random::xor_combine_engine<URNG1, s1, URNG2, s2>::shift2;
SPROUT_CONSTEXPR_OR_CONST int sprout::random::xor_combine_engine<URNG1, s1, URNG2, s2>::shift2;
} // namespace random
using sprout::random::xor_combine_engine;

View file

@ -5,6 +5,7 @@
#include <sprout/range/adaptor/copied.hpp>
#include <sprout/range/adaptor/transformed.hpp>
#include <sprout/range/adaptor/counting.hpp>
#include <sprout/range/adaptor/sized.hpp>
#include <sprout/range/adaptor/size_enumed.hpp>
#include <sprout/range/adaptor/sinusoidal.hpp>

View file

@ -0,0 +1,152 @@
#ifndef SPROUT_RANGE_ADAPTOR_SIZED_HPP
#define SPROUT_RANGE_ADAPTOR_SIZED_HPP
#include <cstddef>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/pit.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/range/range_container.hpp>
#include <sprout/range/algorithm/copy.hpp>
#include <sprout/type_traits/lvalue_reference.hpp>
#include <sprout/utility/forward.hpp>
#include <sprout/utility/lvalue_forward.hpp>
namespace sprout {
namespace adaptors {
namespace detail {
template<typename Range, typename sprout::container_traits<Range>::size_type Size, typename = void>
class sized_impl;
template<typename Range, typename sprout::container_traits<Range>::size_type Size>
class sized_impl<
Range, Size,
typename std::enable_if<sprout::detail::has_static_size<sprout::container_traits<Range> >::value>::type
> {
public:
SPROUT_STATIC_CONSTEXPR typename sprout::container_traits<Range>::size_type
static_size = Size < sprout::container_traits<Range>::static_size ? Size
: sprout::container_traits<Range>::static_size
;
static SPROUT_CONSTEXPR typename sprout::container_traits<Range>::size_type fixed_size() {
return static_size;
}
};
template<typename Range, typename sprout::container_traits<Range>::size_type Size>
SPROUT_CONSTEXPR_OR_CONST typename sprout::container_traits<Range>::size_type sized_impl<
Range, Size,
typename std::enable_if<sprout::detail::has_static_size<sprout::container_traits<Range> >::value>::type
>::static_size;
template<typename Range, typename sprout::container_traits<Range>::size_type Size>
class sized_impl<
Range, Size,
typename std::enable_if<!sprout::detail::has_static_size<sprout::container_traits<Range> >::value>::type
> {
public:
SPROUT_STATIC_CONSTEXPR typename sprout::container_traits<Range>::size_type static_size = Size;
static SPROUT_CONSTEXPR typename sprout::container_traits<Range>::size_type fixed_size() {
return static_size;
}
};
template<typename Range, typename sprout::container_traits<Range>::size_type Size>
SPROUT_CONSTEXPR_OR_CONST typename sprout::container_traits<Range>::size_type sized_impl<
Range, Size,
typename std::enable_if<!sprout::detail::has_static_size<sprout::container_traits<Range> >::value>::type
>::static_size;
} // namespace detail
//
// sized_range
//
template<typename Range, typename sprout::container_traits<Range>::size_type Size>
class sized_range
: public sprout::range::range_container<
typename sprout::container_traits<Range>::iterator
>
, public sprout::adaptors::detail::sized_impl<Range, Size>
{
public:
typedef Range range_type;
typedef sprout::range::range_container<
typename sprout::container_traits<Range>::iterator
> base_type;
private:
typedef sprout::adaptors::detail::sized_impl<Range, Size> sized_impl_type;
public:
sized_range() = default;
sized_range(sized_range const&) = default;
explicit SPROUT_CONSTEXPR sized_range(range_type& range)
: base_type(
sprout::begin(range),
sized_impl_type::static_size < sprout::size(range)
? sprout::next(sprout::begin(range), sized_impl_type::static_size)
: sprout::end(range)
)
{}
};
//
// size_holder
//
template<std::size_t Size>
class size_holder
: public std::integral_constant<std::size_t, Size>
{};
//
// sized
//
template<std::size_t Size>
inline SPROUT_CONSTEXPR sprout::adaptors::size_holder<Size> sized() {
return sprout::adaptors::size_holder<Size>();
}
//
// operator|
//
template<typename Range, std::size_t Size>
inline SPROUT_CONSTEXPR sprout::adaptors::sized_range<
typename std::remove_reference<typename sprout::lvalue_reference<Range>::type>::type,
Size
>
operator|(Range&& lhs, sprout::adaptors::size_holder<Size> const& rhs) {
return sprout::adaptors::sized_range<
typename std::remove_reference<typename sprout::lvalue_reference<Range>::type>::type,
Size
>(
sprout::lvalue_forward<Range>(lhs)
);
}
} // namespace adaptors
//
// container_construct_traits
//
template<typename Range, typename sprout::container_traits<Range>::size_type Size>
struct container_construct_traits<sprout::adaptors::sized_range<Range, Size> > {
public:
typedef typename sprout::container_construct_traits<Range>::copied_type copied_type;
public:
template<typename Cont>
static SPROUT_CONSTEXPR copied_type deep_copy(Cont&& cont) {
return sprout::range::fixed::copy(sprout::forward<Cont>(cont), sprout::pit<copied_type>());
}
template<typename... Args>
static SPROUT_CONSTEXPR copied_type make(Args&&... args) {
return sprout::make<copied_type>(sprout::forward<Args>(args)...);
}
template<typename Cont, typename... Args>
static SPROUT_CONSTEXPR copied_type remake(
Cont&& cont,
typename sprout::container_traits<sprout::adaptors::sized_range<Range, Size> >::difference_type size,
Args&&... args
)
{
return sprout::remake<copied_type>(sprout::forward<Cont>(cont), size, sprout::forward<Args>(args)...);
}
};
} // namespace sprout
#endif // #ifndef SPROUT_RANGE_ADAPTOR_SIZED_HPP

View file

@ -430,9 +430,9 @@ namespace sprout {
#endif
};
template<typename T, std::size_t N, typename Traits>
SPROUT_CONSTEXPR typename sprout::basic_string<T, N, Traits>::size_type sprout::basic_string<T, N, Traits>::npos;
SPROUT_CONSTEXPR_OR_CONST typename sprout::basic_string<T, N, Traits>::size_type sprout::basic_string<T, N, Traits>::npos;
template<typename T, std::size_t N, typename Traits>
SPROUT_CONSTEXPR typename sprout::basic_string<T, N, Traits>::size_type sprout::basic_string<T, N, Traits>::static_size;
SPROUT_CONSTEXPR_OR_CONST typename sprout::basic_string<T, N, Traits>::size_type sprout::basic_string<T, N, Traits>::static_size;
//
// swap

View file

@ -356,7 +356,7 @@ namespace sprout {
}
};
template<typename Container>
SPROUT_CONSTEXPR typename sprout::sub_array<Container>::size_type sprout::sub_array<Container>::static_size;
SPROUT_CONSTEXPR_OR_CONST typename sprout::sub_array<Container>::size_type sprout::sub_array<Container>::static_size;
//
// swap

View file

@ -378,7 +378,7 @@ namespace sprout {
//
// ignore
//
static SPROUT_CONSTEXPR ignore_t ignore{};
SPROUT_STATIC_CONSTEXPR ignore_t ignore{};
//
// make_tuple

View file

@ -51,7 +51,7 @@
SPROUT_STATIC_CONSTEXPR typename std::decay<decltype(T::CONSTANT)>::type ALIAS = T::CONSTANT; \
}; \
template<typename T> \
SPROUT_CONSTEXPR typename std::decay<decltype(T::CONSTANT)>::type NAME< \
SPROUT_CONSTEXPR_OR_CONST typename std::decay<decltype(T::CONSTANT)>::type NAME< \
T, \
typename std::enable_if<SPROUT_PP_CAT(SPROUT_PP_CAT(sprout_inherit_if_xxx_constant_def_impl_has_, CONSTANT), __LINE__)<T>::value>::type \
>::ALIAS

View file

@ -15,48 +15,76 @@ namespace sprout {
template<>
struct digits<char> {
public:
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char, 22> table = sprout::to_string("0123456789abcdefABCDEF");
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char, 22> table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(sprout::to_string("0123456789abcdefABCDEF"))
;
SPROUT_STATIC_CONSTEXPR char dash = '-';
};
SPROUT_CONSTEXPR sprout::basic_string<char, 22> sprout::uuids::detail::digits<char>::table;
SPROUT_CONSTEXPR char sprout::uuids::detail::digits<char>::dash;
SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<char, 22> sprout::uuids::detail::digits<char>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(sprout::to_string("0123456789abcdefABCDEF"))
;
SPROUT_CONSTEXPR_OR_CONST char sprout::uuids::detail::digits<char>::dash;
template<>
struct digits<wchar_t> {
public:
SPROUT_STATIC_CONSTEXPR sprout::basic_string<wchar_t, 22> table = sprout::to_string(L"0123456789abcdefABCDEF");
SPROUT_STATIC_CONSTEXPR sprout::basic_string<wchar_t, 22> table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(sprout::to_string(L"0123456789abcdefABCDEF"))
;
SPROUT_STATIC_CONSTEXPR wchar_t dash = L'-';
};
SPROUT_CONSTEXPR sprout::basic_string<wchar_t, 22> sprout::uuids::detail::digits<wchar_t>::table;
SPROUT_CONSTEXPR wchar_t sprout::uuids::detail::digits<wchar_t>::dash;
SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<wchar_t, 22> sprout::uuids::detail::digits<wchar_t>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(sprout::to_string(L"0123456789abcdefABCDEF"))
;
SPROUT_CONSTEXPR_OR_CONST wchar_t sprout::uuids::detail::digits<wchar_t>::dash;
template<>
struct digits<char16_t> {
public:
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char16_t, 22> table = sprout::to_string(u"0123456789abcdefABCDEF");
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char16_t, 22> table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(sprout::to_string(u"0123456789abcdefABCDEF"))
;
SPROUT_STATIC_CONSTEXPR char16_t dash = u'-';
};
SPROUT_CONSTEXPR sprout::basic_string<char16_t, 22> sprout::uuids::detail::digits<char16_t>::table;
SPROUT_CONSTEXPR char16_t sprout::uuids::detail::digits<char16_t>::dash;
SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<char16_t, 22> sprout::uuids::detail::digits<char16_t>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(sprout::to_string(u"0123456789abcdefABCDEF"))
;
SPROUT_CONSTEXPR_OR_CONST char16_t sprout::uuids::detail::digits<char16_t>::dash;
template<>
struct digits<char32_t> {
public:
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char32_t, 22> table = sprout::to_string(U"0123456789abcdefABCDEF");
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char32_t, 22> table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(sprout::to_string(U"0123456789abcdefABCDEF"))
;
SPROUT_STATIC_CONSTEXPR char32_t dash = U'-';
};
SPROUT_CONSTEXPR sprout::basic_string<char32_t, 22> sprout::uuids::detail::digits<char32_t>::table;
SPROUT_CONSTEXPR char32_t sprout::uuids::detail::digits<char32_t>::dash;
SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<char32_t, 22> sprout::uuids::detail::digits<char32_t>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(sprout::to_string(U"0123456789abcdefABCDEF"))
;
SPROUT_CONSTEXPR_OR_CONST char32_t sprout::uuids::detail::digits<char32_t>::dash;
template<typename Dummy>
struct values;
# define SPROUT_UUID_TABLE_DEF \
table_type{{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 10, 11, 12, 13, 14, 15}}
template<>
struct values<void> {
public:
SPROUT_STATIC_CONSTEXPR sprout::array<std::uint8_t, 22> table = sprout::array<std::uint8_t, 22>{{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 10, 11, 12, 13, 14, 15}};
typedef sprout::array<std::uint8_t, 22> table_type;
public:
SPROUT_STATIC_CONSTEXPR table_type table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(SPROUT_UUID_TABLE_DEF)
;
};
SPROUT_CONSTEXPR sprout::array<std::uint8_t, 22> sprout::uuids::detail::values<void>::table;
SPROUT_CONSTEXPR_OR_CONST sprout::uuids::detail::values<void>::table_type
sprout::uuids::detail::values<void>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_UUID_TABLE_DEF)
;
# undef SPROUT_UUID_TABLE_DEF
} // namespace detail
} // namespace uuids
} // namespace sprout

View file

@ -18,42 +18,68 @@ namespace sprout {
template<>
struct bdigits<char> {
public:
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char, 2> table = sprout::to_string("01");
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char, 2> table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(sprout::to_string("01"))
;
};
SPROUT_CONSTEXPR sprout::basic_string<char, 2> sprout::weed::detail::bdigits<char>::table;
SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<char, 2> sprout::weed::detail::bdigits<char>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(sprout::to_string("01"))
;
template<>
struct bdigits<wchar_t> {
public:
SPROUT_STATIC_CONSTEXPR sprout::basic_string<wchar_t, 2> table = sprout::to_string(L"01");
SPROUT_STATIC_CONSTEXPR sprout::basic_string<wchar_t, 2> table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(sprout::to_string(L"01"))
;
};
SPROUT_CONSTEXPR sprout::basic_string<wchar_t, 2> sprout::weed::detail::bdigits<wchar_t>::table;
SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<wchar_t, 2> sprout::weed::detail::bdigits<wchar_t>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(sprout::to_string(L"01"))
;
template<>
struct bdigits<char16_t> {
public:
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char16_t, 2> table = sprout::to_string(u"01");
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char16_t, 2> table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(sprout::to_string(u"01"))
;
};
SPROUT_CONSTEXPR sprout::basic_string<char16_t, 2> sprout::weed::detail::bdigits<char16_t>::table;
SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<char16_t, 2> sprout::weed::detail::bdigits<char16_t>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(sprout::to_string(u"01"))
;
template<>
struct bdigits<char32_t> {
public:
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char32_t, 2> table = sprout::to_string(U"01");
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char32_t, 2> table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(sprout::to_string(U"01"))
;
};
SPROUT_CONSTEXPR sprout::basic_string<char32_t, 2> sprout::weed::detail::bdigits<char32_t>::table;
SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<char32_t, 2> sprout::weed::detail::bdigits<char32_t>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(sprout::to_string(U"01"))
;
template<typename Dummy>
struct bvalues;
# define SPROUT_WEED_BDIGITS_TABLE_DEF \
table_type{{0, 1}}
template<>
struct bvalues<void> {
public:
SPROUT_STATIC_CONSTEXPR sprout::array<std::uint8_t, 2> table = sprout::array<std::uint8_t, 2>{
{0, 1}
};
typedef sprout::array<std::uint8_t, 2> table_type;
public:
SPROUT_STATIC_CONSTEXPR table_type table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(SPROUT_WEED_BDIGITS_TABLE_DEF)
;
};
SPROUT_CONSTEXPR sprout::array<std::uint8_t, 2> sprout::weed::detail::bvalues<void>::table;
SPROUT_CONSTEXPR_OR_CONST sprout::weed::detail::bvalues<void>::table_type
sprout::weed::detail::bvalues<void>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_WEED_BDIGITS_TABLE_DEF)
;
# undef SPROUT_WEED_BDIGITS_TABLE_DEF
template<typename IntType>
SPROUT_CONSTEXPR sprout::tuples::tuple<IntType, bool> bvalue_at(std::size_t i) {

View file

@ -18,42 +18,68 @@ namespace sprout {
template<>
struct digits<char> {
public:
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char, 10> table = sprout::to_string("0123456789");
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char, 10> table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(sprout::to_string("0123456789"))
;
};
SPROUT_CONSTEXPR sprout::basic_string<char, 10> sprout::weed::detail::digits<char>::table;
SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<char, 10> sprout::weed::detail::digits<char>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(sprout::to_string("0123456789"))
;
template<>
struct digits<wchar_t> {
public:
SPROUT_STATIC_CONSTEXPR sprout::basic_string<wchar_t, 10> table = sprout::to_string(L"0123456789");
SPROUT_STATIC_CONSTEXPR sprout::basic_string<wchar_t, 10> table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(sprout::to_string(L"0123456789"))
;
};
SPROUT_CONSTEXPR sprout::basic_string<wchar_t, 10> sprout::weed::detail::digits<wchar_t>::table;
SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<wchar_t, 10> sprout::weed::detail::digits<wchar_t>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(sprout::to_string(L"0123456789"))
;
template<>
struct digits<char16_t> {
public:
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char16_t, 10> table = sprout::to_string(u"0123456789");
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char16_t, 10> table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(sprout::to_string(u"0123456789"))
;
};
SPROUT_CONSTEXPR sprout::basic_string<char16_t, 10> sprout::weed::detail::digits<char16_t>::table;
SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<char16_t, 10> sprout::weed::detail::digits<char16_t>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(sprout::to_string(u"0123456789"))
;
template<>
struct digits<char32_t> {
public:
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char32_t, 10> table = sprout::to_string(U"0123456789");
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char32_t, 10> table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(sprout::to_string(U"0123456789"))
;
};
SPROUT_CONSTEXPR sprout::basic_string<char32_t, 10> sprout::weed::detail::digits<char32_t>::table;
SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<char32_t, 10> sprout::weed::detail::digits<char32_t>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(sprout::to_string(U"0123456789"))
;
template<typename Dummy>
struct values;
# define SPROUT_WEED_DIGITS_TABLE_DEF \
table_type{{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}}
template<>
struct values<void> {
public:
SPROUT_STATIC_CONSTEXPR sprout::array<std::uint8_t, 10> table = sprout::array<std::uint8_t, 10>{
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
};
typedef sprout::array<std::uint8_t, 10> table_type;
public:
SPROUT_STATIC_CONSTEXPR table_type table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(SPROUT_WEED_DIGITS_TABLE_DEF)
;
};
SPROUT_CONSTEXPR sprout::array<std::uint8_t, 10> sprout::weed::detail::values<void>::table;
SPROUT_CONSTEXPR_OR_CONST sprout::weed::detail::values<void>::table_type
sprout::weed::detail::values<void>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_WEED_DIGITS_TABLE_DEF)
;
# undef SPROUT_WEED_DIGITS_TABLE_DEF
template<typename IntType>
SPROUT_CONSTEXPR sprout::tuples::tuple<IntType, bool> value_at(std::size_t i) {

View file

@ -18,42 +18,68 @@ namespace sprout {
template<>
struct odigits<char> {
public:
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char, 8> table = sprout::to_string("01234567");
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char, 8> table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(sprout::to_string("01234567"))
;
};
SPROUT_CONSTEXPR sprout::basic_string<char, 8> sprout::weed::detail::odigits<char>::table;
SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<char, 8> sprout::weed::detail::odigits<char>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(sprout::to_string("01234567"))
;
template<>
struct odigits<wchar_t> {
public:
SPROUT_STATIC_CONSTEXPR sprout::basic_string<wchar_t, 8> table = sprout::to_string(L"01234567");
SPROUT_STATIC_CONSTEXPR sprout::basic_string<wchar_t, 8> table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(sprout::to_string(L"01234567"))
;
};
SPROUT_CONSTEXPR sprout::basic_string<wchar_t, 8> sprout::weed::detail::odigits<wchar_t>::table;
SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<wchar_t, 8> sprout::weed::detail::odigits<wchar_t>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(sprout::to_string(L"01234567"))
;
template<>
struct odigits<char16_t> {
public:
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char16_t, 8> table = sprout::to_string(u"01234567");
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char16_t, 8> table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(sprout::to_string(u"01234567"))
;
};
SPROUT_CONSTEXPR sprout::basic_string<char16_t, 8> sprout::weed::detail::odigits<char16_t>::table;
SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<char16_t, 8> sprout::weed::detail::odigits<char16_t>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(sprout::to_string(u"01234567"))
;
template<>
struct odigits<char32_t> {
public:
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char32_t, 8> table = sprout::to_string(U"01234567");
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char32_t, 8> table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(sprout::to_string(U"01234567"))
;
};
SPROUT_CONSTEXPR sprout::basic_string<char32_t, 8> sprout::weed::detail::odigits<char32_t>::table;
SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<char32_t, 8> sprout::weed::detail::odigits<char32_t>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(sprout::to_string(U"01234567"))
;
template<typename Dummy>
struct ovalues;
# define SPROUT_WEED_ODIGITS_TABLE_DEF \
table_type{{0, 1, 2, 3, 4, 5, 6, 7}}
template<>
struct ovalues<void> {
public:
SPROUT_STATIC_CONSTEXPR sprout::array<std::uint8_t, 8> table = sprout::array<std::uint8_t, 8>{
{0, 1, 2, 3, 4, 5, 6, 7}
};
typedef sprout::array<std::uint8_t, 8> table_type;
public:
SPROUT_STATIC_CONSTEXPR table_type table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(SPROUT_WEED_ODIGITS_TABLE_DEF)
;
};
SPROUT_CONSTEXPR sprout::array<std::uint8_t, 8> sprout::weed::detail::ovalues<void>::table;
SPROUT_CONSTEXPR_OR_CONST sprout::weed::detail::ovalues<void>::table_type
sprout::weed::detail::ovalues<void>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_WEED_ODIGITS_TABLE_DEF)
;
# undef SPROUT_WEED_ODIGITS_TABLE_DEF
template<typename IntType>
SPROUT_CONSTEXPR sprout::tuples::tuple<IntType, bool> ovalue_at(std::size_t i) {

View file

@ -18,42 +18,68 @@ namespace sprout {
template<>
struct xdigits<char> {
public:
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char, 22> table = sprout::to_string("0123456789abcdefABCDEF");
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char, 22> table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(sprout::to_string("0123456789abcdefABCDEF"))
;
};
SPROUT_CONSTEXPR sprout::basic_string<char, 22> sprout::weed::detail::xdigits<char>::table;
SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<char, 22> sprout::weed::detail::xdigits<char>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(sprout::to_string("0123456789abcdefABCDEF"))
;
template<>
struct xdigits<wchar_t> {
public:
SPROUT_STATIC_CONSTEXPR sprout::basic_string<wchar_t, 22> table = sprout::to_string(L"0123456789abcdefABCDEF");
SPROUT_STATIC_CONSTEXPR sprout::basic_string<wchar_t, 22> table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(sprout::to_string(L"0123456789abcdefABCDEF"))
;
};
SPROUT_CONSTEXPR sprout::basic_string<wchar_t, 22> sprout::weed::detail::xdigits<wchar_t>::table;
SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<wchar_t, 22> sprout::weed::detail::xdigits<wchar_t>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(sprout::to_string(L"0123456789abcdefABCDEF"))
;
template<>
struct xdigits<char16_t> {
public:
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char16_t, 22> table = sprout::to_string(u"0123456789abcdefABCDEF");
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char16_t, 22> table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(sprout::to_string(u"0123456789abcdefABCDEF"))
;
};
SPROUT_CONSTEXPR sprout::basic_string<char16_t, 22> sprout::weed::detail::xdigits<char16_t>::table;
SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<char16_t, 22> sprout::weed::detail::xdigits<char16_t>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(sprout::to_string(u"0123456789abcdefABCDEF"))
;
template<>
struct xdigits<char32_t> {
public:
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char32_t, 22> table = sprout::to_string(U"0123456789abcdefABCDEF");
SPROUT_STATIC_CONSTEXPR sprout::basic_string<char32_t, 22> table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(sprout::to_string(U"0123456789abcdefABCDEF"))
;
};
SPROUT_CONSTEXPR sprout::basic_string<char32_t, 22> sprout::weed::detail::xdigits<char32_t>::table;
SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<char32_t, 22> sprout::weed::detail::xdigits<char32_t>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(sprout::to_string(U"0123456789abcdefABCDEF"))
;
template<typename Dummy>
struct xvalues;
# define SPROUT_WEED_XDIGITS_TABLE_DEF \
table_type{{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 10, 11, 12, 13, 14, 15}}
template<>
struct xvalues<void> {
public:
SPROUT_STATIC_CONSTEXPR sprout::array<std::uint8_t, 22> table = sprout::array<std::uint8_t, 22>{
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 10, 11, 12, 13, 14, 15}
};
typedef sprout::array<std::uint8_t, 22> table_type;
public:
SPROUT_STATIC_CONSTEXPR table_type table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(SPROUT_WEED_XDIGITS_TABLE_DEF)
;
};
SPROUT_CONSTEXPR sprout::array<std::uint8_t, 22> sprout::weed::detail::xvalues<void>::table;
SPROUT_CONSTEXPR_OR_CONST sprout::weed::detail::xvalues<void>::table_type
sprout::weed::detail::xvalues<void>::table
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_WEED_XDIGITS_TABLE_DEF)
;
# undef SPROUT_WEED_XDIGITS_TABLE_DEF
template<typename IntType>
SPROUT_CONSTEXPR sprout::tuples::tuple<IntType, bool> xvalue_at(std::size_t i) {

View file

@ -62,7 +62,7 @@ namespace sprout {
}
};
template<typename Parser, std::size_t Limit>
SPROUT_CONSTEXPR std::size_t limit_p<Parser, Limit>::limit;
SPROUT_CONSTEXPR_OR_CONST std::size_t limit_p<Parser, Limit>::limit;
//
// lim