mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2024-12-23 21:25:49 +00:00
rename type_traits is_int -> is_sint
add new type_traits is_*_unqualified
This commit is contained in:
parent
86db277625
commit
7e709630c6
12 changed files with 172 additions and 42 deletions
|
@ -14,7 +14,7 @@
|
||||||
#include <sprout/limits.hpp>
|
#include <sprout/limits.hpp>
|
||||||
#include <sprout/algorithm/clamp.hpp>
|
#include <sprout/algorithm/clamp.hpp>
|
||||||
#include <sprout/utility/forward.hpp>
|
#include <sprout/utility/forward.hpp>
|
||||||
#include <sprout/type_traits/is_int.hpp>
|
#include <sprout/type_traits/is_sint.hpp>
|
||||||
#include <sprout/type_traits/is_uint.hpp>
|
#include <sprout/type_traits/is_uint.hpp>
|
||||||
#include <sprout/range/adaptor/transformed.hpp>
|
#include <sprout/range/adaptor/transformed.hpp>
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ namespace sprout {
|
||||||
template<typename IntType>
|
template<typename IntType>
|
||||||
struct normalized_to_pcm_wave<
|
struct normalized_to_pcm_wave<
|
||||||
IntType,
|
IntType,
|
||||||
typename std::enable_if<sprout::is_int<IntType>::value>::type
|
typename std::enable_if<sprout::is_sint<IntType>::value>::type
|
||||||
> {
|
> {
|
||||||
public:
|
public:
|
||||||
typedef IntType result_type;
|
typedef IntType result_type;
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/type_traits/enabler_if.hpp>
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
#include <sprout/type_traits/is_int.hpp>
|
#include <sprout/type_traits/is_sint.hpp>
|
||||||
#include <sprout/type_traits/is_uint.hpp>
|
#include <sprout/type_traits/is_uint.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
|
@ -56,7 +56,7 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
template<
|
template<
|
||||||
int Base = 10, typename IntType,
|
int Base = 10, typename IntType,
|
||||||
typename sprout::enabler_if<sprout::is_int<IntType>::value>::type = sprout::enabler
|
typename sprout::enabler_if<sprout::is_sint<IntType>::value>::type = sprout::enabler
|
||||||
>
|
>
|
||||||
inline SPROUT_CONSTEXPR int
|
inline SPROUT_CONSTEXPR int
|
||||||
int_digit_at(IntType val, int digits) {
|
int_digit_at(IntType val, int digits) {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/type_traits/is_int.hpp>
|
#include <sprout/type_traits/is_sint.hpp>
|
||||||
#include <sprout/type_traits/is_uint.hpp>
|
#include <sprout/type_traits/is_uint.hpp>
|
||||||
#include <sprout/type_traits/enabler_if.hpp>
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ namespace sprout {
|
||||||
}
|
}
|
||||||
template<
|
template<
|
||||||
typename T, typename IntType,
|
typename T, typename IntType,
|
||||||
typename sprout::enabler_if<sprout::is_int<IntType>::value>::type = sprout::enabler
|
typename sprout::enabler_if<sprout::is_sint<IntType>::value>::type = sprout::enabler
|
||||||
>
|
>
|
||||||
inline SPROUT_CONSTEXPR T
|
inline SPROUT_CONSTEXPR T
|
||||||
pow_n(T const& x, IntType n) {
|
pow_n(T const& x, IntType n) {
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include <sprout/functional/type_traits/weak_result_type.hpp>
|
#include <sprout/functional/type_traits/weak_result_type.hpp>
|
||||||
#include <sprout/functional/bind/placeholder.hpp>
|
#include <sprout/functional/bind/placeholder.hpp>
|
||||||
#include <sprout/type_traits/integral_constant.hpp>
|
#include <sprout/type_traits/integral_constant.hpp>
|
||||||
|
#include <sprout/type_traits/identity.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
// 20.8.9 bind
|
// 20.8.9 bind
|
||||||
|
@ -514,9 +515,9 @@ namespace sprout {
|
||||||
binder(binder const&) = default;
|
binder(binder const&) = default;
|
||||||
template<
|
template<
|
||||||
typename... Args,
|
typename... Args,
|
||||||
typename Result = decltype(
|
typename Result = typename sprout::identity<decltype(
|
||||||
impl_type::template call_(std::declval<sprout::tuples::tuple<Args...> >(), sprout::detail::bound_indexes<bounds_type, sizeof...(Args)>::make())
|
impl_type::template call_(std::declval<sprout::tuples::tuple<Args...> >(), sprout::detail::bound_indexes<bounds_type, sizeof...(Args)>::make())
|
||||||
)
|
)>::type
|
||||||
>
|
>
|
||||||
Result operator()(Args&&... args) {
|
Result operator()(Args&&... args) {
|
||||||
return impl_type::template call<Result>(
|
return impl_type::template call<Result>(
|
||||||
|
@ -526,9 +527,9 @@ namespace sprout {
|
||||||
}
|
}
|
||||||
template<
|
template<
|
||||||
typename... Args,
|
typename... Args,
|
||||||
typename Result = decltype(
|
typename Result = typename sprout::identity<decltype(
|
||||||
impl_type::template call_c_(std::declval<sprout::tuples::tuple<Args...> >(), sprout::detail::bound_indexes<bounds_type, sizeof...(Args)>::make())
|
impl_type::template call_c_(std::declval<sprout::tuples::tuple<Args...> >(), sprout::detail::bound_indexes<bounds_type, sizeof...(Args)>::make())
|
||||||
)
|
)>::type
|
||||||
>
|
>
|
||||||
SPROUT_CONSTEXPR Result operator()(Args&&... args) const {
|
SPROUT_CONSTEXPR Result operator()(Args&&... args) const {
|
||||||
return impl_type::template call_c<Result>(
|
return impl_type::template call_c<Result>(
|
||||||
|
@ -538,9 +539,9 @@ namespace sprout {
|
||||||
}
|
}
|
||||||
template<
|
template<
|
||||||
typename... Args,
|
typename... Args,
|
||||||
typename Result = decltype(
|
typename Result = typename sprout::identity<decltype(
|
||||||
impl_type::template call_v_(std::declval<sprout::tuples::tuple<Args...> >(), sprout::detail::bound_indexes<bounds_type, sizeof...(Args)>::make())
|
impl_type::template call_v_(std::declval<sprout::tuples::tuple<Args...> >(), sprout::detail::bound_indexes<bounds_type, sizeof...(Args)>::make())
|
||||||
)
|
)>::type
|
||||||
>
|
>
|
||||||
Result operator()(Args&&... args) volatile {
|
Result operator()(Args&&... args) volatile {
|
||||||
return impl_type::template call_v<Result>(
|
return impl_type::template call_v<Result>(
|
||||||
|
@ -550,9 +551,9 @@ namespace sprout {
|
||||||
}
|
}
|
||||||
template<
|
template<
|
||||||
typename... Args,
|
typename... Args,
|
||||||
typename Result = decltype(
|
typename Result = typename sprout::identity<decltype(
|
||||||
impl_type::template call_cv_(std::declval<sprout::tuples::tuple<Args...> >(), sprout::detail::bound_indexes<bounds_type, sizeof...(Args)>::make())
|
impl_type::template call_cv_(std::declval<sprout::tuples::tuple<Args...> >(), sprout::detail::bound_indexes<bounds_type, sizeof...(Args)>::make())
|
||||||
)
|
)>::type
|
||||||
>
|
>
|
||||||
SPROUT_CONSTEXPR Result operator()(Args&&... args) const volatile {
|
SPROUT_CONSTEXPR Result operator()(Args&&... args) const volatile {
|
||||||
return impl_type::template call_cv<Result>(
|
return impl_type::template call_cv<Result>(
|
||||||
|
@ -581,9 +582,9 @@ namespace sprout {
|
||||||
cbinder(cbinder const&) = default;
|
cbinder(cbinder const&) = default;
|
||||||
template<
|
template<
|
||||||
typename... Args,
|
typename... Args,
|
||||||
typename Result = decltype(
|
typename Result = typename sprout::identity<decltype(
|
||||||
impl_type::template call_c_(std::declval<sprout::tuples::tuple<Args...> >(), sprout::detail::bound_indexes<bounds_type, sizeof...(Args)>::make())
|
impl_type::template call_c_(std::declval<sprout::tuples::tuple<Args...> >(), sprout::detail::bound_indexes<bounds_type, sizeof...(Args)>::make())
|
||||||
)
|
)>::type
|
||||||
>
|
>
|
||||||
SPROUT_CONSTEXPR Result operator()(Args&&... args) const {
|
SPROUT_CONSTEXPR Result operator()(Args&&... args) const {
|
||||||
return impl_type::template call_c<Result>(
|
return impl_type::template call_c<Result>(
|
||||||
|
@ -593,9 +594,9 @@ namespace sprout {
|
||||||
}
|
}
|
||||||
template<
|
template<
|
||||||
typename... Args,
|
typename... Args,
|
||||||
typename Result = decltype(
|
typename Result = typename sprout::identity<decltype(
|
||||||
impl_type::template call_cv_(std::declval<sprout::tuples::tuple<Args...> >(), sprout::detail::bound_indexes<bounds_type, sizeof...(Args)>::make())
|
impl_type::template call_cv_(std::declval<sprout::tuples::tuple<Args...> >(), sprout::detail::bound_indexes<bounds_type, sizeof...(Args)>::make())
|
||||||
)
|
)>::type
|
||||||
>
|
>
|
||||||
SPROUT_CONSTEXPR Result operator()(Args&&... args) const volatile {
|
SPROUT_CONSTEXPR Result operator()(Args&&... args) const volatile {
|
||||||
return impl_type::template call_cv<Result>(
|
return impl_type::template call_cv<Result>(
|
||||||
|
|
|
@ -23,13 +23,13 @@ namespace sprout {
|
||||||
public:
|
public:
|
||||||
template<
|
template<
|
||||||
typename U = T,
|
typename U = T,
|
||||||
typename = decltype(std::declval<U>().generated_value())
|
typename = typename sprout::identity<decltype(std::declval<U>().generated_value())>::type
|
||||||
>
|
>
|
||||||
static sprout::true_type test(int);
|
static sprout::true_type test(int);
|
||||||
static sprout::false_type test(...);
|
static sprout::false_type test(...);
|
||||||
};
|
};
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
template<typename T, typename Base_ = decltype(sprout::generators::detail::has_mem_generated_value_test<T>::test(0))>
|
template<typename T, typename Base_ = typename sprout::identity<decltype(sprout::generators::detail::has_mem_generated_value_test<T>::test(0))>::type>
|
||||||
struct has_mem_generated_value
|
struct has_mem_generated_value
|
||||||
: public Base_
|
: public Base_
|
||||||
{};
|
{};
|
||||||
|
@ -98,13 +98,13 @@ namespace sprout {
|
||||||
public:
|
public:
|
||||||
template<
|
template<
|
||||||
typename U = T,
|
typename U = T,
|
||||||
typename = decltype(std::declval<U>().next_generator())
|
typename = typename sprout::identity<decltype(std::declval<U>().next_generator())>::type
|
||||||
>
|
>
|
||||||
static sprout::true_type test(int);
|
static sprout::true_type test(int);
|
||||||
static sprout::false_type test(...);
|
static sprout::false_type test(...);
|
||||||
};
|
};
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
template<typename T, typename Base_ = decltype(sprout::generators::detail::has_mem_next_generator_test<T>::test(0))>
|
template<typename T, typename Base_ = typename sprout::identity<decltype(sprout::generators::detail::has_mem_next_generator_test<T>::test(0))>::type>
|
||||||
struct has_mem_next_generator
|
struct has_mem_next_generator
|
||||||
: public Base_
|
: public Base_
|
||||||
{};
|
{};
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/cstdint.hpp>
|
#include <sprout/cstdint.hpp>
|
||||||
#include <sprout/array/array.hpp>
|
#include <sprout/array/array.hpp>
|
||||||
#include <sprout/type_traits/is_int.hpp>
|
#include <sprout/type_traits/is_sint.hpp>
|
||||||
#include <sprout/type_traits/is_uint.hpp>
|
#include <sprout/type_traits/is_uint.hpp>
|
||||||
#include <sprout/assert.hpp>
|
#include <sprout/assert.hpp>
|
||||||
|
|
||||||
|
@ -530,7 +530,7 @@ namespace sprout {
|
||||||
struct factorials;
|
struct factorials;
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct factorials<T, typename std::enable_if<sprout::is_int<T>::value && sizeof(T) == 1>::type> {
|
struct factorials<T, typename std::enable_if<sprout::is_sint<T>::value && sizeof(T) == 1>::type> {
|
||||||
public:
|
public:
|
||||||
typedef T type;
|
typedef T type;
|
||||||
public:
|
public:
|
||||||
|
@ -544,9 +544,9 @@ namespace sprout {
|
||||||
};
|
};
|
||||||
template<typename T>
|
template<typename T>
|
||||||
SPROUT_CONSTEXPR_OR_CONST typename sprout::math::detail::factorials<
|
SPROUT_CONSTEXPR_OR_CONST typename sprout::math::detail::factorials<
|
||||||
T, typename std::enable_if<sprout::is_int<T>::value && sizeof(T) == 1>::type
|
T, typename std::enable_if<sprout::is_sint<T>::value && sizeof(T) == 1>::type
|
||||||
>::table_type sprout::math::detail::factorials<
|
>::table_type sprout::math::detail::factorials<
|
||||||
T, typename std::enable_if<sprout::is_int<T>::value && sizeof(T) == 1>::type
|
T, typename std::enable_if<sprout::is_sint<T>::value && sizeof(T) == 1>::type
|
||||||
>::table SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_FACTORIAL_TABLE_DEF_INT_1);
|
>::table SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_FACTORIAL_TABLE_DEF_INT_1);
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
@ -570,7 +570,7 @@ namespace sprout {
|
||||||
>::table SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_FACTORIAL_TABLE_DEF_UINT_1);
|
>::table SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_FACTORIAL_TABLE_DEF_UINT_1);
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct factorials<T, typename std::enable_if<sprout::is_int<T>::value && sizeof(T) == 2>::type> {
|
struct factorials<T, typename std::enable_if<sprout::is_sint<T>::value && sizeof(T) == 2>::type> {
|
||||||
public:
|
public:
|
||||||
typedef T type;
|
typedef T type;
|
||||||
public:
|
public:
|
||||||
|
@ -584,9 +584,9 @@ namespace sprout {
|
||||||
};
|
};
|
||||||
template<typename T>
|
template<typename T>
|
||||||
SPROUT_CONSTEXPR_OR_CONST typename sprout::math::detail::factorials<
|
SPROUT_CONSTEXPR_OR_CONST typename sprout::math::detail::factorials<
|
||||||
T, typename std::enable_if<sprout::is_int<T>::value && sizeof(T) == 2>::type
|
T, typename std::enable_if<sprout::is_sint<T>::value && sizeof(T) == 2>::type
|
||||||
>::table_type sprout::math::detail::factorials<
|
>::table_type sprout::math::detail::factorials<
|
||||||
T, typename std::enable_if<sprout::is_int<T>::value && sizeof(T) == 2>::type
|
T, typename std::enable_if<sprout::is_sint<T>::value && sizeof(T) == 2>::type
|
||||||
>::table SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_FACTORIAL_TABLE_DEF_INT_2);
|
>::table SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_FACTORIAL_TABLE_DEF_INT_2);
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
@ -610,7 +610,7 @@ namespace sprout {
|
||||||
>::table SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_FACTORIAL_TABLE_DEF_UINT_2);
|
>::table SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_FACTORIAL_TABLE_DEF_UINT_2);
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct factorials<T, typename std::enable_if<sprout::is_int<T>::value && sizeof(T) == 4>::type> {
|
struct factorials<T, typename std::enable_if<sprout::is_sint<T>::value && sizeof(T) == 4>::type> {
|
||||||
public:
|
public:
|
||||||
typedef T type;
|
typedef T type;
|
||||||
public:
|
public:
|
||||||
|
@ -624,9 +624,9 @@ namespace sprout {
|
||||||
};
|
};
|
||||||
template<typename T>
|
template<typename T>
|
||||||
SPROUT_CONSTEXPR_OR_CONST typename sprout::math::detail::factorials<
|
SPROUT_CONSTEXPR_OR_CONST typename sprout::math::detail::factorials<
|
||||||
T, typename std::enable_if<sprout::is_int<T>::value && sizeof(T) == 4>::type
|
T, typename std::enable_if<sprout::is_sint<T>::value && sizeof(T) == 4>::type
|
||||||
>::table_type sprout::math::detail::factorials<
|
>::table_type sprout::math::detail::factorials<
|
||||||
T, typename std::enable_if<sprout::is_int<T>::value && sizeof(T) == 4>::type
|
T, typename std::enable_if<sprout::is_sint<T>::value && sizeof(T) == 4>::type
|
||||||
>::table SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_FACTORIAL_TABLE_DEF_INT_4);
|
>::table SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_FACTORIAL_TABLE_DEF_INT_4);
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
@ -650,7 +650,7 @@ namespace sprout {
|
||||||
>::table SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_FACTORIAL_TABLE_DEF_UINT_4);
|
>::table SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_FACTORIAL_TABLE_DEF_UINT_4);
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct factorials<T, typename std::enable_if<sprout::is_int<T>::value && sizeof(T) == 8>::type> {
|
struct factorials<T, typename std::enable_if<sprout::is_sint<T>::value && sizeof(T) == 8>::type> {
|
||||||
public:
|
public:
|
||||||
typedef T type;
|
typedef T type;
|
||||||
public:
|
public:
|
||||||
|
@ -664,9 +664,9 @@ namespace sprout {
|
||||||
};
|
};
|
||||||
template<typename T>
|
template<typename T>
|
||||||
SPROUT_CONSTEXPR_OR_CONST typename sprout::math::detail::factorials<
|
SPROUT_CONSTEXPR_OR_CONST typename sprout::math::detail::factorials<
|
||||||
T, typename std::enable_if<sprout::is_int<T>::value && sizeof(T) == 8>::type
|
T, typename std::enable_if<sprout::is_sint<T>::value && sizeof(T) == 8>::type
|
||||||
>::table_type sprout::math::detail::factorials<
|
>::table_type sprout::math::detail::factorials<
|
||||||
T, typename std::enable_if<sprout::is_int<T>::value && sizeof(T) == 8>::type
|
T, typename std::enable_if<sprout::is_sint<T>::value && sizeof(T) == 8>::type
|
||||||
>::table SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_FACTORIAL_TABLE_DEF_INT_8);
|
>::table SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(SPROUT_FACTORIAL_TABLE_DEF_INT_8);
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
@ -8,7 +8,9 @@
|
||||||
#ifndef SPROUT_RANDOM_TYPE_TRAITS_HPP
|
#ifndef SPROUT_RANDOM_TYPE_TRAITS_HPP
|
||||||
#define SPROUT_RANDOM_TYPE_TRAITS_HPP
|
#define SPROUT_RANDOM_TYPE_TRAITS_HPP
|
||||||
|
|
||||||
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/type_traits/integral_constant.hpp>
|
||||||
#include <sprout/type_traits/has_xxx.hpp>
|
#include <sprout/type_traits/has_xxx.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
|
@ -17,6 +19,45 @@ namespace sprout {
|
||||||
// is_seed_seq
|
// is_seed_seq
|
||||||
//
|
//
|
||||||
SPROUT_HAS_XXX_TYPE_DEF(is_seed_seq, result_type);
|
SPROUT_HAS_XXX_TYPE_DEF(is_seed_seq, result_type);
|
||||||
|
|
||||||
|
//
|
||||||
|
// is_real_std_random_parameter
|
||||||
|
// is_int_std_random_parameter
|
||||||
|
// is_uint_std_random_parameter
|
||||||
|
//
|
||||||
|
template<typename RealType>
|
||||||
|
struct is_real_std_random_parameter
|
||||||
|
: public sprout::integral_constant<
|
||||||
|
bool,
|
||||||
|
std::is_same<RealType, float>::value
|
||||||
|
|| std::is_same<RealType, double>::value
|
||||||
|
|| std::is_same<RealType, long double>::value
|
||||||
|
>
|
||||||
|
{};
|
||||||
|
template<typename IntType>
|
||||||
|
struct is_int_std_random_parameter
|
||||||
|
: public sprout::integral_constant<
|
||||||
|
bool,
|
||||||
|
std::is_same<IntType, short>::value
|
||||||
|
|| std::is_same<IntType, int>::value
|
||||||
|
|| std::is_same<IntType, long>::value
|
||||||
|
|| std::is_same<IntType, long long>::value
|
||||||
|
|| std::is_same<IntType, unsigned short>::value
|
||||||
|
|| std::is_same<IntType, unsigned int>::value
|
||||||
|
|| std::is_same<IntType, unsigned long>::value
|
||||||
|
|| std::is_same<IntType, unsigned long long>::value
|
||||||
|
>
|
||||||
|
{};
|
||||||
|
template<typename UIntType>
|
||||||
|
struct is_uint_std_random_parameter
|
||||||
|
: public sprout::integral_constant<
|
||||||
|
bool,
|
||||||
|
std::is_same<UIntType, unsigned short>::value
|
||||||
|
|| std::is_same<UIntType, unsigned int>::value
|
||||||
|
|| std::is_same<UIntType, unsigned long>::value
|
||||||
|
|| std::is_same<UIntType, unsigned long long>::value
|
||||||
|
>
|
||||||
|
{};
|
||||||
} // namespace random
|
} // namespace random
|
||||||
} // namespace sprout
|
} // namespace sprout
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,10 @@
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/type_traits/std.hpp>
|
#include <sprout/type_traits/std.hpp>
|
||||||
#include <sprout/type_traits/is_convert_constructible.hpp>
|
#include <sprout/type_traits/is_convert_constructible.hpp>
|
||||||
#include <sprout/type_traits/is_int.hpp>
|
#include <sprout/type_traits/is_const_unqualified.hpp>
|
||||||
|
#include <sprout/type_traits/is_volatile_unqualified.hpp>
|
||||||
|
#include <sprout/type_traits/is_cv_unqualified.hpp>
|
||||||
|
#include <sprout/type_traits/is_sint.hpp>
|
||||||
#include <sprout/type_traits/is_uint.hpp>
|
#include <sprout/type_traits/is_uint.hpp>
|
||||||
#include <sprout/type_traits/is_char_type.hpp>
|
#include <sprout/type_traits/is_char_type.hpp>
|
||||||
#include <sprout/type_traits/is_c_str.hpp>
|
#include <sprout/type_traits/is_c_str.hpp>
|
||||||
|
|
28
sprout/type_traits/is_const_unqualified.hpp
Normal file
28
sprout/type_traits/is_const_unqualified.hpp
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_TYPE_TRAITS_IS_CONST_UNQUALIFIED_HPP
|
||||||
|
#define SPROUT_TYPE_TRAITS_IS_CONST_UNQUALIFIED_HPP
|
||||||
|
|
||||||
|
#include <type_traits>
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/type_traits/integral_constant.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
//
|
||||||
|
// is_const_unqualified
|
||||||
|
//
|
||||||
|
template<typename T>
|
||||||
|
struct is_const_unqualified
|
||||||
|
: public sprout::integral_constant<
|
||||||
|
bool,
|
||||||
|
std::is_const<T>::value
|
||||||
|
>
|
||||||
|
{};
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_CONST_UNQUALIFIED_HPP
|
29
sprout/type_traits/is_cv_unqualified.hpp
Normal file
29
sprout/type_traits/is_cv_unqualified.hpp
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_TYPE_TRAITS_IS_CV_UNQUALIFIED_HPP
|
||||||
|
#define SPROUT_TYPE_TRAITS_IS_CV_UNQUALIFIED_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/type_traits/integral_constant.hpp>
|
||||||
|
#include <sprout/type_traits/is_const_unqualified.hpp>
|
||||||
|
#include <sprout/type_traits/is_volatile_unqualified.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
//
|
||||||
|
// is_cv_unqualified
|
||||||
|
//
|
||||||
|
template<typename T>
|
||||||
|
struct is_cv_unqualified
|
||||||
|
: public sprout::integral_constant<
|
||||||
|
bool,
|
||||||
|
sprout::is_const_unqualified<T>::value && sprout::is_volatile_unqualified<T>::value
|
||||||
|
>
|
||||||
|
{};
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_CV_UNQUALIFIED_HPP
|
|
@ -5,8 +5,8 @@
|
||||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
=============================================================================*/
|
=============================================================================*/
|
||||||
#ifndef SPROUT_TYPE_TRAITS_IS_INT_HPP
|
#ifndef SPROUT_TYPE_TRAITS_IS_SINT_HPP
|
||||||
#define SPROUT_TYPE_TRAITS_IS_INT_HPP
|
#define SPROUT_TYPE_TRAITS_IS_SINT_HPP
|
||||||
|
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
|
@ -14,10 +14,10 @@
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
//
|
//
|
||||||
// is_int
|
// is_sint
|
||||||
//
|
//
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct is_int
|
struct is_sint
|
||||||
: public sprout::integral_constant<
|
: public sprout::integral_constant<
|
||||||
bool,
|
bool,
|
||||||
std::is_integral<T>::value && std::is_signed<T>::value
|
std::is_integral<T>::value && std::is_signed<T>::value
|
||||||
|
@ -26,8 +26,8 @@ namespace sprout {
|
||||||
|
|
||||||
#if SPROUT_USE_TEMPLATE_ALIASES
|
#if SPROUT_USE_TEMPLATE_ALIASES
|
||||||
template<typename T>
|
template<typename T>
|
||||||
using is_int_t = typename sprout::is_int<T>::type;
|
using is_sint_t = typename sprout::is_sint<T>::type;
|
||||||
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
|
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
|
||||||
} // namespace sprout
|
} // namespace sprout
|
||||||
|
|
||||||
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_INT_HPP
|
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_SINT_HPP
|
28
sprout/type_traits/is_volatile_unqualified.hpp
Normal file
28
sprout/type_traits/is_volatile_unqualified.hpp
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_TYPE_TRAITS_IS_VOLATILE_UNQUALIFIED_HPP
|
||||||
|
#define SPROUT_TYPE_TRAITS_IS_VOLATILE_UNQUALIFIED_HPP
|
||||||
|
|
||||||
|
#include <type_traits>
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/type_traits/integral_constant.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
//
|
||||||
|
// is_volatile_unqualified
|
||||||
|
//
|
||||||
|
template<typename T>
|
||||||
|
struct is_volatile_unqualified
|
||||||
|
: public sprout::integral_constant<
|
||||||
|
bool,
|
||||||
|
std::is_volatile<T>::value
|
||||||
|
>
|
||||||
|
{};
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_VOLATILE_UNQUALIFIED_HPP
|
Loading…
Reference in a new issue