fix config for C++14

This commit is contained in:
bolero-MURAKAMI 2014-08-01 15:24:00 +09:00
parent 3d89eae1e9
commit d0d2b677bc
20 changed files with 41 additions and 14 deletions

View file

@ -71,10 +71,12 @@
#include "./swap_element_copy.cpp"
#include "./random_swap.cpp"
#include "./random_swap_result.cpp"
#ifndef TESTSPR_CONFIG_DISABLE_MONKEY_SORT_TEST
# include "./bogo_sort.cpp"
# include "./bogo_sort_result.cpp"
# include "./bozo_sort.cpp"
# include "./bozo_sort_result.cpp"
#endif
#ifdef TESTSPR_CPP_INCLUDE_DISABLE_SPROUT_LIBS_ALGORITHM_TEST_MODIFYIING_CPP
# undef TESTSPR_CPP_INCLUDE
@ -140,10 +142,12 @@ namespace testspr {
testspr::algorithm_swap_element_copy_test();
testspr::algorithm_random_swap_test();
testspr::algorithm_random_swap_result_test();
#ifndef TESTSPR_CONFIG_DISABLE_MONKEY_SORT_TEST
testspr::algorithm_bogo_sort_test();
testspr::algorithm_bogo_sort_result_test();
testspr::algorithm_bozo_sort_test();
testspr::algorithm_bozo_sort_result_test();
#endif
}
} // namespace testspr

View file

@ -37,9 +37,9 @@
// SPROUT_CXX14_STATIC_CONSTEXPR
//
#ifndef SPROUT_CONFIG_DISABLE_CXX14_CONSTEXPR
# define SPROUT_CXX14_CONSTEXPR constexpr
# define SPROUT_CXX14_CONSTEXPR_OR_CONST constexpr
# define SPROUT_CXX14_STATIC_CONSTEXPR static constexpr
# define SPROUT_CXX14_CONSTEXPR SPROUT_CONSTEXPR
# define SPROUT_CXX14_CONSTEXPR_OR_CONST SPROUT_CONSTEXPR_OR_CONST
# define SPROUT_CXX14_STATIC_CONSTEXPR SPROUT_STATIC_CONSTEXPR
#else // #ifndef SPROUT_CONFIG_DISABLE_CXX14_CONSTEXPR
# define SPROUT_CXX14_CONSTEXPR
# define SPROUT_CXX14_CONSTEXPR_OR_CONST const

View file

@ -24,6 +24,7 @@ namespace sprout {
class exempt_ptr {
public:
typedef T value_type;
typedef T element_type;
typedef T* pointer;
typedef T const* const_pointer;
typedef T& reference;

View file

@ -67,6 +67,7 @@ namespace sprout {
SPROUT_CONSTEXPR additive_combine_engine()
: mlcg1_(), mlcg2_()
{}
additive_combine_engine(additive_combine_engine const&) = default;
explicit SPROUT_CONSTEXPR additive_combine_engine(result_type seed)
: mlcg1_(seed), mlcg2_(seed)
{}

View file

@ -37,6 +37,7 @@ namespace sprout {
SPROUT_CONSTEXPR param_type()
: p_(RealType(0.5))
{}
param_type(param_type const&) = default;
explicit SPROUT_CONSTEXPR param_type(RealType p_arg)
: p_((SPROUT_ASSERT(p_arg >= RealType(0)), SPROUT_ASSERT(p_arg <= RealType(1)), p_arg))
{}
@ -94,6 +95,7 @@ namespace sprout {
SPROUT_CONSTEXPR bernoulli_distribution() SPROUT_NOEXCEPT
: p_(RealType(0.5))
{}
bernoulli_distribution(bernoulli_distribution const&) = default;
explicit SPROUT_CONSTEXPR bernoulli_distribution(RealType p_arg)
: p_((SPROUT_ASSERT(p_arg >= RealType(0)), SPROUT_ASSERT(p_arg <= RealType(1)), p_arg))
{}

View file

@ -92,6 +92,7 @@ namespace sprout {
: t_(1)
, p_(0.5)
{}
param_type(param_type const&) = default;
explicit SPROUT_CONSTEXPR param_type(IntType t_arg, RealType p_arg = RealType(0.5))
: t_((SPROUT_ASSERT(t_arg >= IntType(0)), t_arg))
, p_((SPROUT_ASSERT(RealType(0) <= p_arg && p_arg <= RealType(1)), p_arg))
@ -708,6 +709,7 @@ namespace sprout {
, btrd_(!init_use_inversion(1, RealType(0.5)) ? init_btrd(1, RealType(0.5)) : btrd_type())
, q_n_(init_use_inversion(1, RealType(0.5)) ? init_q_n(1, RealType(0.5)) : RealType())
{}
binomial_distribution(binomial_distribution const&) = default;
explicit SPROUT_CONSTEXPR binomial_distribution(IntType t_arg, RealType p_arg = RealType(0.5))
: t_((SPROUT_ASSERT(t_arg >= IntType(0)), t_arg))
, p_((SPROUT_ASSERT(RealType(0) <= p_arg && p_arg <= RealType(1)), p_arg))

View file

@ -41,6 +41,7 @@ namespace sprout {
SPROUT_CONSTEXPR param_type()
: p_(RealType(0.5))
{}
param_type(param_type const&) = default;
explicit SPROUT_CONSTEXPR param_type(RealType p_arg)
: p_((SPROUT_ASSERT(RealType(0) < p_arg), SPROUT_ASSERT(p_arg < RealType(1)), p_arg))
{}
@ -105,6 +106,7 @@ namespace sprout {
: p_(RealType(0.5))
, log_1mp_(init_log_1mp(RealType(0.5)))
{}
geometric_distribution(geometric_distribution const&) = default;
explicit SPROUT_CONSTEXPR geometric_distribution(RealType p_arg)
: p_((SPROUT_ASSERT(RealType(0) < p_arg), SPROUT_ASSERT(p_arg < RealType(1)), p_arg))
, log_1mp_(init_log_1mp(p_arg))

View file

@ -85,6 +85,7 @@ namespace sprout {
SPROUT_CONSTEXPR inversive_congruential_engine()
: x_(init_seed(default_seed))
{}
inversive_congruential_engine(inversive_congruential_engine const&) = default;
explicit SPROUT_CONSTEXPR inversive_congruential_engine(result_type x0)
: x_(init_seed(x0))
{}

View file

@ -89,6 +89,7 @@ namespace sprout {
SPROUT_CONSTEXPR linear_congruential_engine()
: x_(init_seed())
{}
linear_congruential_engine(linear_congruential_engine const&) = default;
explicit SPROUT_CONSTEXPR linear_congruential_engine(result_type x0)
: x_(init_seed(x0))
{}

View file

@ -84,6 +84,7 @@ namespace sprout {
SPROUT_CONSTEXPR linear_feedback_shift_engine()
: x_(init_seed(default_seed))
{}
linear_feedback_shift_engine(linear_feedback_shift_engine const&) = default;
explicit SPROUT_CONSTEXPR linear_feedback_shift_engine(result_type x0)
: x_(init_seed(x0))
{}

View file

@ -376,6 +376,7 @@ namespace sprout {
: x_(init_seed(default_seed))
, i_(n)
{}
mersenne_twister_engine(mersenne_twister_engine const&) = default;
explicit SPROUT_CONSTEXPR mersenne_twister_engine(result_type value)
: x_(init_seed(value))
, i_(n)

View file

@ -49,6 +49,7 @@ namespace sprout {
: mean_(RealType(0.0))
, sigma_(RealType(1.0))
{}
param_type(param_type const&) = default;
explicit SPROUT_CONSTEXPR param_type(RealType mean_arg, RealType sigma_arg = RealType(1.0))
: mean_(mean_arg)
, sigma_((SPROUT_ASSERT(sigma_arg >= RealType(0)), sigma_arg))
@ -167,6 +168,7 @@ namespace sprout {
, cached_rho_(0)
, valid_(false)
{}
normal_distribution(normal_distribution const&) = default;
explicit SPROUT_CONSTEXPR normal_distribution(RealType mean_arg, RealType sigma_arg = RealType(1.0))
: mean_(mean_arg)
, sigma_((SPROUT_ASSERT(sigma_arg >= RealType(0)), sigma_arg))

View file

@ -180,6 +180,7 @@ namespace sprout {
SPROUT_CONSTEXPR shuffle_order_engine()
: member_type(init_member(base_type()))
{}
shuffle_order_engine(shuffle_order_engine const&) = default;
explicit SPROUT_CONSTEXPR shuffle_order_engine(result_type seed)
: member_type(init_member(base_type(seed)))
{}

View file

@ -123,6 +123,7 @@ namespace sprout {
#endif
public:
SPROUT_CONSTEXPR uniform_01() SPROUT_DEFAULTED_DEFAULT_CONSTRUCTOR_DECL
uniform_01(uniform_01 const&) = default;
explicit SPROUT_CONSTEXPR uniform_01(param_type const&) SPROUT_NOEXCEPT {}
SPROUT_CONSTEXPR result_type min() const SPROUT_NOEXCEPT {
return result_type(0);

View file

@ -804,6 +804,7 @@ namespace sprout {
: min_(0)
, max_(sprout::numeric_limits<IntType>::max())
{}
param_type(param_type const&) = default;
explicit SPROUT_CONSTEXPR param_type(IntType min_arg, IntType max_arg = sprout::numeric_limits<IntType>::max())
: min_((SPROUT_ASSERT(min_arg <= max_arg), min_arg))
, max_(max_arg)
@ -864,6 +865,7 @@ namespace sprout {
: min_(0)
, max_(sprout::numeric_limits<IntType>::max())
{}
uniform_int_distribution(uniform_int_distribution const&) = default;
explicit SPROUT_CONSTEXPR uniform_int_distribution(IntType min_arg, IntType max_arg = sprout::numeric_limits<IntType>::max())
: min_((SPROUT_ASSERT(min_arg <= max_arg), min_arg))
, max_(max_arg)

View file

@ -413,6 +413,7 @@ namespace sprout {
: min_(RealType(0.0))
, max_(RealType(1.0))
{}
param_type(param_type const&) = default;
explicit SPROUT_CONSTEXPR param_type(RealType min_arg, RealType max_arg = RealType(1.0))
: min_((SPROUT_ASSERT(min_arg <= max_arg), min_arg))
, max_(max_arg)
@ -473,6 +474,7 @@ namespace sprout {
: min_(RealType(0.0))
, max_(RealType(1.0))
{}
uniform_real_distribution(uniform_real_distribution const&) = default;
explicit SPROUT_CONSTEXPR uniform_real_distribution(RealType min_arg, RealType max_arg = RealType(1.0))
: min_((SPROUT_ASSERT(min_arg <= max_arg), min_arg))
, max_(max_arg)

View file

@ -44,6 +44,7 @@ namespace sprout {
: min_(0)
, max_(sprout::numeric_limits<IntType>::max())
{}
param_type(param_type const&) = default;
explicit SPROUT_CONSTEXPR param_type(IntType min_arg, IntType max_arg = sprout::numeric_limits<IntType>::max())
: min_((SPROUT_ASSERT(min_arg <= max_arg), min_arg))
, max_(max_arg)
@ -234,6 +235,7 @@ namespace sprout {
: min_(0)
, max_(sprout::numeric_limits<IntType>::max())
{}
uniform_smallint(uniform_smallint const&) = default;
explicit SPROUT_CONSTEXPR uniform_smallint(IntType min_arg, IntType max_arg = sprout::numeric_limits<IntType>::max())
: min_((SPROUT_ASSERT(min_arg <= max_arg), min_arg))
, max_(max_arg)

View file

@ -57,6 +57,7 @@ namespace sprout {
SPROUT_CONSTEXPR xor_combine_engine()
: rng1_(), rng2_()
{}
xor_combine_engine(xor_combine_engine const&) = default;
explicit SPROUT_CONSTEXPR xor_combine_engine(result_type seed)
: rng1_(seed), rng2_(seed)
{}