1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2024-11-12 21:09:01 +00:00

all type_traits support C++14 requirements

This commit is contained in:
bolero-MURAKAMI 2013-11-22 21:11:08 +09:00
parent bf0c7021cf
commit 403e83eaf0
95 changed files with 319 additions and 268 deletions

View file

@ -8,8 +8,9 @@
#ifndef SPROUT_ADL_NOT_FOUND_HPP
#define SPROUT_ADL_NOT_FOUND_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
namespace sprout {
//
@ -22,7 +23,7 @@ namespace sprout {
//
template<typename T>
struct is_not_found_via_adl
: public std::is_same<T, sprout::not_found_via_adl>
: public sprout::is_same<T, sprout::not_found_via_adl>
{};
template<typename T>
struct is_not_found_via_adl<T const>
@ -42,7 +43,7 @@ namespace sprout {
//
template<typename T>
struct is_found_via_adl
: public std::integral_constant<bool, !sprout::is_not_found_via_adl<T>::value>
: public sprout::integral_constant<bool, !sprout::is_not_found_via_adl<T>::value>
{};
} // namespace sprout

View file

@ -19,6 +19,7 @@
#include <sprout/range/adaptor/size_enumed.hpp>
#include <sprout/range/algorithm/lower_bound.hpp>
#include <sprout/range/numeric/partial_sum.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/is_c_str.hpp>
namespace sprout {
@ -31,7 +32,7 @@ namespace sprout {
String,
typename std::enable_if<sprout::is_c_str<String>::value>::type
>
: public std::integral_constant<
: public sprout::integral_constant<
typename sprout::container_traits<String>::size_type,
sprout::container_traits<String>::static_size - 1
>
@ -41,7 +42,7 @@ namespace sprout {
String,
typename std::enable_if<!sprout::is_c_str<String>::value>::type
>
: public std::integral_constant<
: public sprout::integral_constant<
typename sprout::container_traits<String>::size_type,
sprout::container_traits<String>::static_size
>

View file

@ -10,11 +10,11 @@
#include <cstddef>
#include <tuple>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/array/array.hpp>
#include <sprout/utility/move.hpp>
#include <sprout/tuple/tuple/get.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
//
@ -49,7 +49,7 @@ namespace std {
//
template<typename T, std::size_t N>
struct tuple_size<sprout::array<T, N> >
: public std::integral_constant<std::size_t, N>
: public sprout::integral_constant<std::size_t, N>
{};
//

View file

@ -9,9 +9,9 @@
#define SPROUT_ARRAY_TYPE_TRAITS_HPP
#include <cstddef>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/array/array.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
//
@ -19,7 +19,7 @@ namespace sprout {
//
template<typename T>
struct is_array_class
: public std::false_type
: public sprout::false_type
{};
template<typename T>
struct is_array_class<T const>
@ -31,7 +31,7 @@ namespace sprout {
{};
template<typename T, std::size_t N>
struct is_array_class<sprout::array<T, N> >
: public std::true_type
: public sprout::true_type
{};
} // namespace sprout

View file

@ -14,6 +14,7 @@
#include <stdexcept>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/detail/sizeof.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/iterator/index_iterator.hpp>
#include <sprout/functional/hash.hpp>
@ -36,11 +37,6 @@
namespace sprout {
namespace detail {
template<typename T>
struct sizeof_
: public std::integral_constant<std::size_t, sizeof(T)>
{};
struct base_bitset_from_words_construct_tag {};
template<std::size_t N>

View file

@ -12,6 +12,7 @@
#include <sprout/config.hpp>
#include <sprout/utility/swap.hpp>
#include <sprout/detail/call_traits.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace detail {
@ -19,27 +20,27 @@ namespace sprout {
struct compressed_pair_switch;
template<typename T1, typename T2>
struct compressed_pair_switch<T1, T2, false, false, false>
: public std::integral_constant<int, 0>
: public sprout::integral_constant<int, 0>
{};
template<typename T1, typename T2>
struct compressed_pair_switch<T1, T2, false, true, false>
: public std::integral_constant<int, 1>
: public sprout::integral_constant<int, 1>
{};
template<typename T1, typename T2>
struct compressed_pair_switch<T1, T2, false, false, true>
: public std::integral_constant<int, 2>
: public sprout::integral_constant<int, 2>
{};
template<typename T1, typename T2>
struct compressed_pair_switch<T1, T2, false, true, true>
: public std::integral_constant<int, 3>
: public sprout::integral_constant<int, 3>
{};
template<typename T1, typename T2>
struct compressed_pair_switch<T1, T2, true, true, true>
: public std::integral_constant<int, 4>
: public sprout::integral_constant<int, 4>
{};
template<typename T1, typename T2>
struct compressed_pair_switch<T1, T2, true, false, false>
: public std::integral_constant<int, 5>
: public sprout::integral_constant<int, 5>
{};
template<typename T1, typename T2, int Version>

View file

@ -13,6 +13,7 @@
#include <array>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/has_xxx.hpp>
#include <sprout/type_traits/inherit_if_xxx.hpp>
#include <sprout/container/detail/array_like.hpp>
@ -91,7 +92,7 @@ namespace sprout {
//
template<typename Container>
struct has_container_nosy_iterator
: public std::integral_constant<
: public sprout::integral_constant<
bool,
sprout::detail::has_iterator<Container>::value
|| sprout::detail::has_const_iterator<Container>::value
@ -102,7 +103,7 @@ namespace sprout {
//
template<typename Container>
struct has_container_nosy_value_type
: public std::integral_constant<
: public sprout::integral_constant<
bool,
sprout::detail::has_value_type<Container>::value
|| sprout::detail::has_container_nosy_iterator<Container>::value
@ -113,7 +114,7 @@ namespace sprout {
//
template<typename Container>
struct has_container_nosy_static_size
: public std::integral_constant<
: public sprout::integral_constant<
bool,
sprout::detail::has_static_size<Container>::value
|| sprout::detail::is_array_like<Container>::value
@ -540,7 +541,7 @@ namespace sprout {
Container,
typename std::enable_if<sprout::is_fixed_container<sprout::container_traits<Container> >::value>::type
>
: public std::integral_constant<
: public sprout::integral_constant<
typename sprout::container_traits<Container>::size_type,
sprout::container_traits<Container>::static_size
>
@ -550,7 +551,7 @@ namespace sprout {
Container,
typename std::enable_if<!sprout::is_fixed_container<sprout::container_traits<Container> >::value>::type
>
: public std::integral_constant<
: public sprout::integral_constant<
typename sprout::container_traits<Container>::size_type,
0
>

View file

@ -9,18 +9,18 @@
#define SPROUT_CONTAINER_DETAIL_ARRAY_LIKE_HPP
#include <cstddef>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace detail {
template<typename Container>
struct is_array_like
: public std::false_type
: public sprout::false_type
{};
template<template<typename, std::size_t> class Array, typename T, std::size_t N>
struct is_array_like<Array<T, N> >
: public std::true_type
: public sprout::true_type
{};
template<typename Container>
struct is_array_like<Container const>
@ -39,7 +39,7 @@ namespace sprout {
struct array_like_static_size {};
template<template<typename, std::size_t> class Array, typename T, std::size_t N>
struct array_like_static_size<Array<T, N> >
: public std::integral_constant<std::size_t, N>
: public sprout::integral_constant<std::size_t, N>
{};
template<typename Container>
struct array_like_static_size<Container const>

View file

@ -11,6 +11,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/container/internal.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace containers {
@ -19,7 +20,7 @@ namespace sprout {
//
template<typename Container>
struct is_sub_container
: public std::integral_constant<
: public sprout::integral_constant<
bool,
!std::is_same<typename sprout::containers::internal<Container>::type, Container&&>::value
>

View file

@ -8,9 +8,9 @@
#ifndef SPROUT_CONTAINER_STATIC_SIZE_HPP
#define SPROUT_CONTAINER_STATIC_SIZE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/container/container_traits.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace containers {
@ -19,7 +19,7 @@ namespace sprout {
//
template<typename Container>
struct static_size
: public std::integral_constant<
: public sprout::integral_constant<
typename sprout::container_traits<Container>::size_type,
sprout::container_traits<Container>::static_size
>

View file

@ -11,6 +11,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/container/container_transform_traits.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace containers {
@ -19,9 +20,9 @@ namespace sprout {
typename T,
template<typename sprout::container_traits<T>::size_type> class = T::template rebind_size
>
std::true_type sprout_has_xxx_impl_check_template_rebind_size(int);
sprout::true_type sprout_has_xxx_impl_check_template_rebind_size(int);
template<typename T>
std::false_type sprout_has_xxx_impl_check_template_rebind_size(long);
sprout::false_type sprout_has_xxx_impl_check_template_rebind_size(long);
#if defined(_MSC_VER)
template<typename T, typename Base_ = decltype(sprout::containers::detail::sprout_has_xxx_impl_check_template_rebind_size<T>(0))>
struct has_rebind_size

View file

@ -8,9 +8,9 @@
#ifndef SPROUT_DARKROOM_ACCESS_TRAITS_HPP
#define SPROUT_DARKROOM_ACCESS_TRAITS_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/tuple/tuple.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace darkroom {
@ -20,7 +20,7 @@ namespace sprout {
//
template<typename T>
struct is_tuple
: public std::false_type
: public sprout::false_type
{};
template<typename T>
struct is_tuple<T const>
@ -36,7 +36,7 @@ namespace sprout {
{};
template<typename... Types>
struct is_tuple<sprout::tuples::tuple<Types...> >
: public std::true_type
: public sprout::true_type
{};
} // namespace access
} // namespace darkroom

View file

@ -8,8 +8,8 @@
#ifndef SPROUT_DETAIL_DIGITS_TO_INT_HPP
#define SPROUT_DETAIL_DIGITS_TO_INT_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace detail {
@ -17,11 +17,11 @@ namespace sprout {
struct digits_to_int;
template<typename IntType, char C>
struct digits_to_int<IntType, C>
: public std::integral_constant<IntType, IntType(C - 48)>
: public sprout::integral_constant<IntType, IntType(C - 48)>
{};
template<typename IntType, char Head, char... Tail>
struct digits_to_int<IntType, Head, Tail...>
: public std::integral_constant<IntType, 10 * IntType(Head - 48) + sprout::detail::digits_to_int<IntType, Tail...>::value>
: public sprout::integral_constant<IntType, 10 * IntType(Head - 48) + sprout::detail::digits_to_int<IntType, Tail...>::value>
{};
} // namespace detail
} // namespace sprout

View file

@ -9,8 +9,8 @@
#define SPROUT_DETAIL_INTEGER_STATIC_LOG2_HPP
#include <cstdint>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace detail {
@ -58,7 +58,7 @@ namespace sprout {
template<sprout::detail::static_log2_argument_type x>
struct static_log2
: public std::integral_constant<
: public sprout::integral_constant<
sprout::detail::static_log2_result_type,
sprout::detail::static_log2_impl::static_log2_impl<x>::value
>

View file

@ -11,12 +11,18 @@
#include <cstddef>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace detail {
template<typename T>
struct sizeof_
: public sprout::integral_constant<std::size_t, sizeof(T)>
{};
template<typename... Ts>
struct sizeof_pack
: public std::integral_constant<std::size_t, sizeof...(Ts)>
: public sprout::integral_constant<std::size_t, sizeof...(Ts)>
{};
} // namespace detail
} // namespace sprout

View file

@ -28,6 +28,7 @@
#include <sprout/functional/mem_fn.hpp>
#include <sprout/functional/type_traits/weak_result_type.hpp>
#include <sprout/functional/bind/placeholder.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
// 20.8.9 bind
@ -37,7 +38,7 @@ namespace sprout {
//
template<typename T>
struct is_bind_expression
: public std::false_type
: public sprout::false_type
{};
template<typename T>
struct is_bind_expression<T const>
@ -201,7 +202,7 @@ namespace sprout {
public:
template<typename T>
struct apply
: public std::integral_constant<
: public sprout::integral_constant<
bool,
(sprout::is_variadic_placeholder<T>::value > 0)
>
@ -209,7 +210,7 @@ namespace sprout {
};
template<typename Bounds, typename = void>
struct is_variadic_bounds
: public std::integral_constant<
: public sprout::integral_constant<
bool,
(sprout::types::find_index_if<Bounds, sprout::detail::is_variadic_placeholder_pred>::value != sprout::tuples::tuple_size<Bounds>::value)
>
@ -217,19 +218,19 @@ namespace sprout {
template<typename T>
struct tail_place
: public std::integral_constant<int, sprout::is_variadic_placeholder<T>::value - 1>
: public sprout::integral_constant<int, sprout::is_variadic_placeholder<T>::value - 1>
{};
template<typename T, std::size_t ArgSize, typename = void>
struct bound_size
: public std::integral_constant<std::size_t, 1>
: public sprout::integral_constant<std::size_t, 1>
{};
template<typename T, std::size_t ArgSize>
struct bound_size<
T, ArgSize,
typename std::enable_if<(sprout::is_variadic_placeholder<T>::value > 0)>::type
>
: public std::integral_constant<
: public sprout::integral_constant<
std::size_t,
(ArgSize - sprout::detail::tail_place<T>::value)
>
@ -237,14 +238,14 @@ namespace sprout {
template<std::size_t I, typename Bounds, std::size_t ArgSize, typename = void>
struct bounds_size_impl
: public std::integral_constant<std::size_t, 0>
: public sprout::integral_constant<std::size_t, 0>
{};
template<std::size_t I, typename Bounds, std::size_t ArgSize>
struct bounds_size_impl<
I, Bounds, ArgSize,
typename std::enable_if<(I < sprout::tuples::tuple_size<Bounds>::value)>::type
>
: public std::integral_constant<
: public sprout::integral_constant<
std::size_t,
(sprout::detail::bound_size<typename sprout::tuples::tuple_element<I, Bounds>::type, ArgSize>::value
+ sprout::detail::bounds_size_impl<I + 1, Bounds, ArgSize>::value
@ -284,11 +285,11 @@ namespace sprout {
template<sprout::index_t I, typename Bounds, std::size_t ArgSize>
struct bound_position
: public std::integral_constant<
: public sprout::integral_constant<
sprout::index_t,
(sprout::types::lower_bound_index<
typename sprout::detail::bounds_partial_size<Bounds, ArgSize>::type,
std::integral_constant<std::size_t, I + 1>
sprout::integral_constant<std::size_t, I + 1>
>::type::value - 1
)
>
@ -296,7 +297,7 @@ namespace sprout {
template<sprout::index_t I, typename Bounds, std::size_t ArgSize>
struct is_variadic_part
: public std::integral_constant<
: public sprout::integral_constant<
bool,
(sprout::is_variadic_placeholder<
typename sprout::tuples::tuple_element<
@ -798,19 +799,19 @@ namespace sprout {
//
template<typename Signature>
struct is_bind_expression<sprout::binder<Signature> >
: public std::true_type
: public sprout::true_type
{};
template<typename Result, typename Signature>
struct is_bind_expression<sprout::res_binder<Result, Signature> >
: public std::true_type
: public sprout::true_type
{};
template<typename Signature>
struct is_bind_expression<sprout::cbinder<Signature> >
: public std::true_type
: public sprout::true_type
{};
template<typename Result, typename Signature>
struct is_bind_expression<sprout::res_cbinder<Result, Signature> >
: public std::true_type
: public sprout::true_type
{};
namespace detail {

View file

@ -8,8 +8,8 @@
#ifndef SPROUT_FUNCTIONAL_BIND_PLACEHOLDER_HPP
#define SPROUT_FUNCTIONAL_BIND_PLACEHOLDER_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
//
@ -171,7 +171,7 @@ namespace sprout {
//
template<typename T>
struct is_placeholder
: public std::integral_constant<int, 0>
: public sprout::integral_constant<int, 0>
{};
template<typename T>
struct is_placeholder<T const>
@ -187,7 +187,7 @@ namespace sprout {
{};
template<int N>
struct is_placeholder<sprout::placeholder<N> >
: public std::integral_constant<int, N>
: public sprout::integral_constant<int, N>
{};
//
@ -195,7 +195,7 @@ namespace sprout {
//
template<typename T>
struct is_positional_placeholder
: public std::integral_constant<int, 0>
: public sprout::integral_constant<int, 0>
{};
template<typename T>
struct is_positional_placeholder<T const>
@ -211,7 +211,7 @@ namespace sprout {
{};
template<>
struct is_positional_placeholder<sprout::positional_placeholder>
: public std::integral_constant<int, 1>
: public sprout::integral_constant<int, 1>
{};
//
@ -219,7 +219,7 @@ namespace sprout {
//
template<typename T>
struct is_variadic_placeholder
: public std::integral_constant<int, 0>
: public sprout::integral_constant<int, 0>
{};
template<typename T>
struct is_variadic_placeholder<T const>
@ -235,7 +235,7 @@ namespace sprout {
{};
template<int N>
struct is_variadic_placeholder<sprout::variadic_placeholder<N> >
: public std::integral_constant<int, N + 1>
: public sprout::integral_constant<int, N + 1>
{};
} // namespace sprout

View file

@ -15,12 +15,13 @@
#include <sprout/limits.hpp>
#include <sprout/functional/hash/hash_fwd.hpp>
#include <sprout/functional/hash/detail/hash_float.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace hash_detail {
template<typename T>
struct is_basic_number
: public std::integral_constant<
: public sprout::integral_constant<
bool,
std::is_integral<T>::value
&& (sizeof(T) <= sizeof(std::size_t))
@ -28,7 +29,7 @@ namespace sprout {
{};
template<typename T>
struct is_long_number
: public std::integral_constant<
: public sprout::integral_constant<
bool,
std::is_integral<T>::value
&& (sizeof(T) > sizeof(std::size_t))
@ -37,7 +38,7 @@ namespace sprout {
{};
template<typename T>
struct is_ulong_number
: public std::integral_constant<
: public sprout::integral_constant<
bool,
std::is_integral<T>::value
&& (sizeof(T) > sizeof(std::size_t))

View file

@ -12,6 +12,7 @@
#include <functional>
#include <sprout/config.hpp>
#include <sprout/utility/forward.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/has_xxx.hpp>
#include <sprout/type_traits/inherit_if_xxx.hpp>
#include <sprout/functional/base.hpp>
@ -211,7 +212,7 @@ namespace sprout {
//
template<typename T>
struct is_reference_wrapper
: public std::false_type
: public sprout::false_type
{};
template<typename T>
struct is_reference_wrapper<T const>
@ -227,7 +228,7 @@ namespace sprout {
{};
template<typename T>
struct is_reference_wrapper<sprout::reference_wrapper<T> >
: public std::true_type
: public sprout::true_type
{};
//

View file

@ -8,9 +8,9 @@
#ifndef SPROUT_FUNCTIONAL_TYPE_TRAITS_IS_STRICT_FUNCTION_HPP
#define SPROUT_FUNCTIONAL_TYPE_TRAITS_IS_STRICT_FUNCTION_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/functional/type_traits/has_type.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
//
@ -18,7 +18,7 @@ namespace sprout {
//
template<typename Fn>
struct is_strict_unary_function
: public std::integral_constant<
: public sprout::integral_constant<
bool,
sprout::has_result_type<Fn>::value
&& sprout::has_argument_type<Fn>::value
@ -29,7 +29,7 @@ namespace sprout {
//
template<typename Fn>
struct is_strict_binary_function
: public std::integral_constant<
: public sprout::integral_constant<
bool,
sprout::has_result_type<Fn>::value
&& sprout::has_first_argument_type<Fn>::value

View file

@ -12,6 +12,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/tuple/tuple.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace generators {
@ -23,8 +24,8 @@ namespace sprout {
typename U = T,
typename = decltype(std::declval<U>().generated_value())
>
static std::true_type test(int);
static std::false_type test(...);
static sprout::true_type test(int);
static sprout::false_type test(...);
};
#if defined(_MSC_VER)
template<typename T, typename Base_ = decltype(sprout::generators::detail::has_mem_generated_value_test<T>::test(0))>
@ -98,8 +99,8 @@ namespace sprout {
typename U = T,
typename = decltype(std::declval<U>().next_generator())
>
static std::true_type test(int);
static std::false_type test(...);
static sprout::true_type test(int);
static sprout::false_type test(...);
};
#if defined(_MSC_VER)
template<typename T, typename Base_ = decltype(sprout::generators::detail::has_mem_next_generator_test<T>::test(0))>

View file

@ -12,12 +12,13 @@
#include <sprout/config.hpp>
#include <sprout/index_tuple/integer_sequence.hpp>
#include <sprout/index_tuple/enable_make_indexes.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace detail {
template<typename T, T First, T Last>
struct integer_range_default_step
: public std::integral_constant<typename std::make_signed<T>::type, (First <= Last ? 1 : -1)>
: public sprout::integral_constant<typename std::make_signed<T>::type, (First <= Last ? 1 : -1)>
{};
} // namespace detail

View file

@ -10,11 +10,11 @@
#include <cstddef>
#include <tuple>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/index_tuple/integer_sequence.hpp>
#include <sprout/index_tuple/index_tuple.hpp>
#include <sprout/utility/pack.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace std {
#if defined(__clang__)
@ -26,7 +26,7 @@ namespace std {
//
template<typename T, T... Is>
struct tuple_size<sprout::integer_sequence<T, Is...> >
: public std::integral_constant<std::size_t, sizeof...(Is)>
: public sprout::integral_constant<std::size_t, sizeof...(Is)>
{};
//
// tuple_element

View file

@ -12,12 +12,13 @@
#include <climits>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace detail {
template<typename IntType, long N, long D>
struct integer_digits_impl
: public std::integral_constant<
: public sprout::integral_constant<
std::size_t,
(CHAR_BIT * sizeof(IntType) - (std::is_signed<IntType>::value ? 1 : 0)) * N / D
+ ((CHAR_BIT * sizeof(IntType) - (std::is_signed<IntType>::value ? 1 : 0)) * N % D ? 1 : 0)

View file

@ -8,8 +8,8 @@
#ifndef SPROUT_INTEGER_STATIC_POW_HPP
#define SPROUT_INTEGER_STATIC_POW_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
//
@ -17,7 +17,7 @@ namespace sprout {
//
template<typename T, T X>
struct static_pow2
: public std::integral_constant<T, (1 << X)>
: public sprout::integral_constant<T, (1 << X)>
{};
namespace detail {
@ -25,11 +25,11 @@ namespace sprout {
struct static_pow2m1;
template<typename T, T X>
struct static_pow2m1<T, X, true>
: public std::integral_constant<T, 1>
: public sprout::integral_constant<T, 1>
{};
template<typename T, T X>
struct static_pow2m1<T, X, false>
: public std::integral_constant<T, ((((T(1) << (X - 1)) - 1) << 1) + 1)>
: public sprout::integral_constant<T, ((((T(1) << (X - 1)) - 1) << 1) + 1)>
{};
} // namespace detail
//
@ -45,15 +45,15 @@ namespace sprout {
struct static_pow;
template<typename T, T X, T Y>
struct static_pow<T, X, Y, 0, false>
: public std::integral_constant<T, 1>
: public sprout::integral_constant<T, 1>
{};
template<typename T, T X, T Y>
struct static_pow<T, X, Y, 1, true>
: public std::integral_constant<T, X>
: public sprout::integral_constant<T, X>
{};
template<typename T, T X, T Y>
struct static_pow<T, X, Y, 2, false>
: public std::integral_constant<T, X * X>
: public sprout::integral_constant<T, X * X>
{};
template<typename T, T X, T Y, int K>
struct static_pow<T, X, Y, K, false>
@ -61,7 +61,7 @@ namespace sprout {
{};
template<typename T, T X, T Y, int K>
struct static_pow<T, X, Y, K, true>
: public std::integral_constant<T, X * sprout::detail::static_pow<T, X, Y - 1>::value>
: public sprout::integral_constant<T, X * sprout::detail::static_pow<T, X, Y - 1>::value>
{};
} // namespace detail
//

View file

@ -13,16 +13,17 @@
#include <utility>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/detail/param_at.hpp>
#include <sprout/index_tuple/metafunction.hpp>
#include <sprout/array/array.hpp>
#include <sprout/string.hpp>
#include <sprout/pit/pit.hpp>
#include <sprout/utility/value_holder/value_holder.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#include <sprout/range/algorithm/lower_bound.hpp>
#include <sprout/range/numeric/partial_sum.hpp>
#include <sprout/type_traits/is_char_type.hpp>
#include <sprout/detail/param_at.hpp>
#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT
namespace sprout {
@ -61,7 +62,7 @@ namespace sprout {
//
template<sprout::io::flags::fmtflags Flag>
struct boolean_flag
: public std::integral_constant<sprout::io::flags::fmtflags, Flag>
: public sprout::integral_constant<sprout::io::flags::fmtflags, Flag>
{
private:
bool flag_;
@ -86,7 +87,7 @@ namespace sprout {
//
template<sprout::io::flags::fmtflags Flag, sprout::io::flags::fmtflags Mask>
struct field_flag
: public std::integral_constant<sprout::io::flags::fmtflags, Flag>
: public sprout::integral_constant<sprout::io::flags::fmtflags, Flag>
{
public:
SPROUT_STATIC_CONSTEXPR sprout::io::flags::fmtflags mask = Mask;
@ -565,15 +566,15 @@ namespace sprout {
struct leaf_count;
template<>
struct leaf_count<sprout::io::root_t>
: public std::integral_constant<std::size_t, 0>
: public sprout::integral_constant<std::size_t, 0>
{};
template<typename T>
struct leaf_count<sprout::io::leaf_expression<T> >
: public std::integral_constant<std::size_t, 1>
: public sprout::integral_constant<std::size_t, 1>
{};
template<typename Left, typename Right>
struct leaf_count<sprout::io::format_expression<Left, Right> >
: public std::integral_constant<
: public sprout::integral_constant<
std::size_t,
sprout::io::detail::leaf_count<Left>::value + sprout::io::detail::leaf_count<Right>::value
>

View file

@ -19,6 +19,7 @@
#include <sprout/iterator/detail/iterator_to_pointer.hpp>
#include <sprout/utility/value_holder/value_holder.hpp>
#include <sprout/utility/swap.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
//
@ -250,7 +251,7 @@ namespace sprout {
//
template<typename T>
struct is_index_iterator
: public std::false_type
: public sprout::false_type
{};
template<typename T>
struct is_index_iterator<T const>
@ -262,7 +263,7 @@ namespace sprout {
{};
template<typename Container, bool C>
struct is_index_iterator<sprout::index_iterator<Container, C> >
: public std::true_type
: public sprout::true_type
{};
//

View file

@ -17,6 +17,7 @@
#include <sprout/iterator/distance.hpp>
#include <sprout/iterator/detail/iterator_to_pointer.hpp>
#include <sprout/utility/swap.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
//
@ -273,7 +274,7 @@ namespace sprout {
//
template<typename T>
struct is_ptr_index_iterator
: public std::false_type
: public sprout::false_type
{};
template<typename T>
struct is_ptr_index_iterator<T const>
@ -285,7 +286,7 @@ namespace sprout {
{};
template<typename T>
struct is_ptr_index_iterator<sprout::ptr_index_iterator<T> >
: public std::true_type
: public sprout::true_type
{};
//

View file

@ -12,6 +12,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/iterator/type_traits/category.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/identity.hpp>
#include <sprout/type_traits/common_decay.hpp>
@ -21,19 +22,19 @@ namespace sprout {
struct iterator_category_hierarchy_impl;
template<typename Category, bool IsBidirectional, bool IsForward, bool IsSinglePassOrIncrementable>
struct iterator_category_hierarchy_impl<Category, true, IsBidirectional, IsForward, IsSinglePassOrIncrementable>
: public std::integral_constant<int, 4>
: public sprout::integral_constant<int, 4>
{};
template<typename Category, bool IsForward, bool IsSinglePassOrIncrementable>
struct iterator_category_hierarchy_impl<Category, false, true, IsForward, IsSinglePassOrIncrementable>
: public std::integral_constant<int, 3>
: public sprout::integral_constant<int, 3>
{};
template<typename Category, bool IsSinglePassOrIncrementable>
struct iterator_category_hierarchy_impl<Category, false, false, true, IsSinglePassOrIncrementable>
: public std::integral_constant<int, 2>
: public sprout::integral_constant<int, 2>
{};
template<typename Category>
struct iterator_category_hierarchy_impl<Category, false, false, false, true>
: public std::integral_constant<int, 1>
: public sprout::integral_constant<int, 1>
{};
template<typename Category>
@ -49,7 +50,7 @@ namespace sprout {
template<typename Category1, typename Category2>
struct iterator_category_less
: public std::integral_constant<
: public sprout::integral_constant<
bool,
(sprout::detail::iterator_category_hierarchy<Category1>::value < sprout::detail::iterator_category_hierarchy<Category2>::value)
>

View file

@ -11,6 +11,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
//
@ -18,7 +19,7 @@ namespace sprout {
//
template<typename MaybeIterator>
struct is_constant_distance_iterator
: public std::integral_constant<
: public sprout::integral_constant<
bool,
#ifdef SPROUT_NO_CXX14_CONSTEXPR
sprout::is_random_access_iterator<MaybeIterator>::value && !std::is_pointer<MaybeIterator>::value

View file

@ -9,8 +9,8 @@
#define SPROUT_ITERATOR_TYPE_TRAITS_IS_ITERATOR_CATEGORY_OF_HPP
#include <iterator>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
namespace sprout {
//
@ -18,7 +18,7 @@ namespace sprout {
//
template<typename MaybeCategory, typename Category>
struct is_iterator_category_of
: public std::is_convertible<MaybeCategory, Category>
: public sprout::is_convertible<MaybeCategory, Category>
{};
//

View file

@ -13,12 +13,13 @@
#include <sprout/config.hpp>
#include <sprout/iterator/type_traits/is_iterator.hpp>
#include <sprout/iterator/type_traits/is_iterator_category_of.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace detail {
template<typename MaybeIterator, typename Category, typename = void>
struct is_iterator_of_impl
: public std::false_type
: public sprout::false_type
{};
template<typename MaybeIterator, typename Category>
struct is_iterator_of_impl<
@ -78,7 +79,7 @@ namespace sprout {
//
template<typename MaybeIterator>
struct is_iterator_outputable
: public std::integral_constant<
: public sprout::integral_constant<
bool,
sprout::is_output_iterator<typename std::decay<MaybeIterator>::type>::value
|| sprout::is_forward_iterator<typename std::decay<MaybeIterator>::type>::value

View file

@ -8,9 +8,9 @@
#ifndef SPROUT_PIT_TYPE_TRAITS_HPP
#define SPROUT_PIT_TYPE_TRAITS_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/pit/pit.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
//
@ -18,7 +18,7 @@ namespace sprout {
//
template<typename T>
struct is_pit
: public std::false_type
: public sprout::false_type
{};
template<typename T>
struct is_pit<T const>
@ -30,7 +30,7 @@ namespace sprout {
{};
template<typename Container>
struct is_pit<sprout::pit<Container> >
: public std::true_type
: public sprout::true_type
{};
} // namespace sprout

View file

@ -16,6 +16,7 @@
#include <sprout/iterator/next.hpp>
#include <sprout/array.hpp>
#include <sprout/pit.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/random/detail/const_mod.hpp>
#include <sprout/detail/integer/static_log2.hpp>
@ -26,13 +27,13 @@ namespace sprout {
struct seed_log
: public std::conditional<
m == 0,
std::integral_constant<int, sprout::numeric_limits<IntType>::digits>,
std::integral_constant<int, sprout::detail::static_log2<m>::value>
sprout::integral_constant<int, sprout::numeric_limits<IntType>::digits>,
sprout::integral_constant<int, sprout::detail::static_log2<m>::value>
>::type
{};
template<typename IntType, IntType m, int log>
struct seed_k
: public std::integral_constant<
: public sprout::integral_constant<
int,
(log + ((~(IntType(2) << (log - 1)) & m)? 32 : 31)) / 32
>

View file

@ -18,6 +18,7 @@
#include <sprout/generator.hpp>
#include <sprout/utility/swap.hpp>
#include <sprout/utility/move.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace random {
@ -365,7 +366,7 @@ namespace std {
//
template<typename Engine, typename Distribution>
struct tuple_size<sprout::random::random_result<Engine, Distribution> >
: public std::integral_constant<std::size_t, 2>
: public sprout::integral_constant<std::size_t, 2>
{};
//

View file

@ -14,6 +14,7 @@
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/range/adaptor/detail/sized_range_default.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/lvalue_reference.hpp>
#include <sprout/utility/forward.hpp>
#include <sprout/utility/lvalue_forward.hpp>
@ -49,7 +50,7 @@ namespace sprout {
//
template<std::size_t Size>
class size_holder
: public std::integral_constant<std::size_t, Size>
: public sprout::integral_constant<std::size_t, Size>
{};
//

View file

@ -17,6 +17,7 @@
#include <sprout/utility/swap.hpp>
#include <sprout/utility/move.hpp>
#include <sprout/utility/forward.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace range {
@ -117,7 +118,7 @@ namespace sprout {
//
template<typename T>
struct is_range_container
: public std::false_type
: public sprout::false_type
{};
template<typename T>
struct is_range_container<T const>
@ -133,7 +134,7 @@ namespace sprout {
{};
template<typename Iterator>
struct is_range_container<sprout::range::range_container<Iterator> >
: public std::true_type
: public sprout::true_type
{};
//

View file

@ -14,6 +14,7 @@
#include <sprout/limits.hpp>
#include <sprout/index_tuple/metafunction.hpp>
#include <sprout/string/string.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#include <sprout/math/isinf.hpp>
#include <sprout/math/isnan.hpp>
@ -34,7 +35,7 @@ namespace sprout {
//
template<typename FloatType>
struct printed_float_digits
: public std::integral_constant<
: public sprout::integral_constant<
std::size_t,
sprout::numeric_limits<FloatType>::max_exponent10 + sprout::detail::decimal_places_length + 2
>
@ -104,7 +105,7 @@ namespace sprout {
namespace detail {
template<typename FloatType>
struct printed_float_exponent10_digits
: public std::integral_constant<
: public sprout::integral_constant<
std::size_t,
NS_SSCRISK_CEL_OR_SPROUT::max(sprout::detail::int_digits(sprout::numeric_limits<FloatType>::max_exponent10), 2)
>
@ -116,7 +117,7 @@ namespace sprout {
//
template<typename FloatType>
struct printed_float_exp_digits
: public std::integral_constant<
: public sprout::integral_constant<
std::size_t,
5 + sprout::detail::decimal_places_length + sprout::detail::printed_float_exponent10_digits<FloatType>::value
>

View file

@ -14,6 +14,7 @@
#include <sprout/index_tuple/metafunction.hpp>
#include <sprout/string/string.hpp>
#include <sprout/integer/integer_digits.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#include <sprout/detail/char_conversion.hpp>
#include <sprout/detail/math/int.hpp>
@ -24,7 +25,7 @@ namespace sprout {
//
template<typename IntType, std::size_t Base = 10>
struct printed_integer_digits
: public std::integral_constant<
: public sprout::integral_constant<
std::size_t,
sprout::integer_digits<IntType, Base>::value + (std::is_signed<IntType>::value ? 1 : 0)
>

View file

@ -8,8 +8,8 @@
#ifndef SPROUT_STRING_NPOS_HPP
#define SPROUT_STRING_NPOS_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/is_uint.hpp>
#include <sprout/type_traits/enabler_if.hpp>
@ -22,7 +22,7 @@ namespace sprout {
public:
template<typename UIntType, typename sprout::enabler_if<sprout::is_uint<UIntType>::value>::type = sprout::enabler>
struct get
: public std::integral_constant<UIntType, UIntType(-1)>
: public sprout::integral_constant<UIntType, UIntType(-1)>
{};
public:
template<typename UIntType, typename sprout::enabler_if<sprout::is_uint<UIntType>::value>::type = sprout::enabler>

View file

@ -27,6 +27,7 @@
#include <sprout/algorithm/cxx14/swap_ranges.hpp>
#include <sprout/utility/forward.hpp>
#include <sprout/utility/swap.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/identity.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#include <sprout/math/less.hpp>
@ -234,7 +235,7 @@ namespace sprout {
#if SPROUT_USE_INDEX_ITERATOR_IMPLEMENTATION
template<typename Iterator>
class is_string_iterator
: public std::false_type
: public sprout::false_type
{};
template<typename Iterator>
class is_string_iterator<Iterator const>
@ -250,11 +251,11 @@ namespace sprout {
{};
template<std::size_t N2>
class is_string_iterator<sprout::index_iterator<basic_string<T, N2, Traits>&, true> >
: public std::true_type
: public sprout::true_type
{};
template<std::size_t N2>
class is_string_iterator<sprout::index_iterator<basic_string<T, N2, Traits> const&, true> >
: public std::true_type
: public sprout::true_type
{};
#endif
public:

View file

@ -10,11 +10,11 @@
#include <cstddef>
#include <tuple>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/string/string.hpp>
#include <sprout/utility/move.hpp>
#include <sprout/tuple/tuple/get.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
//
@ -49,7 +49,7 @@ namespace std {
//
template<typename T, std::size_t N, typename Traits>
struct tuple_size<sprout::basic_string<T, N, Traits> >
: public std::integral_constant<std::size_t, N>
: public sprout::integral_constant<std::size_t, N>
{};
//

View file

@ -9,9 +9,9 @@
#define SPROUT_STRING_TYPE_TRAITS_HPP
#include <cstddef>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/string/string.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
//
@ -52,7 +52,7 @@ namespace sprout {
//
template<typename T>
struct is_basic_string
: public std::false_type
: public sprout::false_type
{};
template<typename T>
struct is_basic_string<T const>
@ -64,7 +64,7 @@ namespace sprout {
{};
template<typename T, std::size_t N, typename Traits>
struct is_basic_string<sprout::basic_string<T, N, Traits> >
: public std::true_type
: public sprout::true_type
{};
//
@ -72,7 +72,7 @@ namespace sprout {
//
template<typename T, typename Elem>
struct is_string_of
: public std::false_type
: public sprout::false_type
{};
template<typename T, typename Elem>
struct is_string_of<T const, Elem>
@ -84,7 +84,7 @@ namespace sprout {
{};
template<typename T, std::size_t N, typename Traits, typename Elem>
struct is_string_of<sprout::basic_string<T, N, Traits>, Elem>
: public std::true_type
: public sprout::true_type
{};
//

View file

@ -8,9 +8,9 @@
#ifndef SPROUT_SUB_ARRAY_TYPE_TRAITS_HPP
#define SPROUT_SUB_ARRAY_TYPE_TRAITS_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/sub_array/sub_array.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
//
@ -18,7 +18,7 @@ namespace sprout {
//
template<typename T>
struct is_sub_array
: public std::false_type
: public sprout::false_type
{};
template<typename T>
struct is_sub_array<T const>
@ -30,7 +30,7 @@ namespace sprout {
{};
template<typename Container>
struct is_sub_array<sprout::sub_array<Container> >
: public std::true_type
: public sprout::true_type
{};
} // namespace sprout

View file

@ -9,11 +9,11 @@
#define SPROUT_TUPLE_SSCRISK_CEL_UTILITY_HPP
#include <cstddef>
#include <type_traits>
#include <sscrisk/cel/utility.hpp>
#include <sprout/config.hpp>
#include <sprout/utility/move.hpp>
#include <sprout/tuple/tuple.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace tuples {
@ -22,7 +22,7 @@ namespace sprout {
//
template<typename T1, typename T2>
struct tuple_size<sscrisk::cel::pair<T1, T2> >
: public std::integral_constant<std::size_t, 2>
: public sprout::integral_constant<std::size_t, 2>
{};
namespace detail {

View file

@ -20,6 +20,7 @@
#include <sprout/utility/swap.hpp>
#include <sprout/utility/pack.hpp>
#include <sprout/utility/pair/pair_fwd.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/is_convert_constructible.hpp>
#include <sprout/tpp/algorithm/all_of.hpp>
#include <sprout/tuple/tuple/tuple_fwd.hpp>
@ -290,7 +291,7 @@ namespace sprout {
template<typename... UTypes>
struct is_fixedly_convert_constructible
: public std::integral_constant<
: public sprout::integral_constant<
bool,
(sizeof...(UTypes) == sizeof...(Types) && is_flexibly_convert_constructible<UTypes...>::value)
>
@ -495,7 +496,7 @@ namespace std {
//
template<typename... Types>
struct tuple_size<sprout::tuples::tuple<Types...> >
: public std::integral_constant<std::size_t, sizeof...(Types)>
: public sprout::integral_constant<std::size_t, sizeof...(Types)>
{};
//

View file

@ -8,9 +8,9 @@
#ifndef SPROUT_TUPLE_TUPLE_TYPE_TRAITS_HPP
#define SPROUT_TUPLE_TUPLE_TYPE_TRAITS_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/tuple/tuple/tuple_fwd.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace tuples {
@ -19,7 +19,7 @@ namespace sprout {
//
template<typename T>
struct is_tuple
: public std::false_type
: public sprout::false_type
{};
template<typename T>
struct is_tuple<T const>
@ -31,7 +31,7 @@ namespace sprout {
{};
template<typename... Types>
struct is_tuple<sprout::tuples::tuple<Types...> >
: public std::true_type
: public sprout::true_type
{};
} // namespace tuples

View file

@ -12,6 +12,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type/tuple.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace types {
@ -26,7 +27,7 @@ namespace sprout {
|| std::is_same<typename sprout::types::tuple_element<I, Tuple>::type, T>::value
>::type
>
: public std::integral_constant<std::size_t, I>
: public sprout::integral_constant<std::size_t, I>
{};
template<typename Tuple, typename T, std::size_t I>
struct find_index_impl<

View file

@ -12,6 +12,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type/tuple.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace types {
@ -26,7 +27,7 @@ namespace sprout {
|| Predicate::template apply<typename sprout::types::tuple_element<I, Tuple>::type>::type::value
>::type
>
: public std::integral_constant<std::size_t, I>
: public sprout::integral_constant<std::size_t, I>
{};
template<typename Tuple, typename Predicate, std::size_t I>
struct find_index_if_impl<

View file

@ -13,6 +13,7 @@
#include <sprout/config.hpp>
#include <sprout/type/functional/less.hpp>
#include <sprout/type/tuple.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace types {
@ -29,7 +30,7 @@ namespace sprout {
Tuple, T, Compare, First, Last,
0
>
: public std::integral_constant<std::size_t, Last>
: public sprout::integral_constant<std::size_t, Last>
{};
template<
typename Tuple, typename T, typename Compare, std::size_t First, std::size_t Last
@ -38,7 +39,7 @@ namespace sprout {
Tuple, T, Compare, First, Last,
1
>
: public std::integral_constant<
: public sprout::integral_constant<
std::size_t,
Compare::template apply<typename sprout::types::tuple_element<First, Tuple>::type, T>::type::value ? Last : First
>

View file

@ -13,6 +13,7 @@
#include <sprout/config.hpp>
#include <sprout/type/functional/less.hpp>
#include <sprout/type/tuple.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace types {
@ -29,7 +30,7 @@ namespace sprout {
Tuple, T, Compare, First, Last,
0
>
: public std::integral_constant<std::size_t, Last>
: public sprout::integral_constant<std::size_t, Last>
{};
template<
typename Tuple, typename T, typename Compare, std::size_t First, std::size_t Last
@ -38,7 +39,7 @@ namespace sprout {
Tuple, T, Compare, First, Last,
1
>
: public std::integral_constant<
: public sprout::integral_constant<
std::size_t,
!Compare::template apply<T, typename sprout::types::tuple_element<First, Tuple>::type>::type::value ? Last : First
>

View file

@ -8,8 +8,8 @@
#ifndef SPROUT_TYPE_FUNCTIONAL_LESS_HPP
#define SPROUT_TYPE_FUNCTIONAL_LESS_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace types {
@ -18,7 +18,7 @@ namespace sprout {
//
template<typename T, typename U>
struct less
: public std::integral_constant<bool, ((T::value) < (U::value))>
: public sprout::integral_constant<bool, ((T::value) < (U::value))>
{};
//

View file

@ -10,11 +10,11 @@
#include <cstddef>
#include <tuple>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type/tuple.hpp>
#include <sprout/type/type_tuple.hpp>
#include <sprout/tuple/tuple/get.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace types {
@ -23,7 +23,7 @@ namespace sprout {
//
template<typename T, T... Values>
struct integral_array
: public sprout::types::type_tuple<std::integral_constant<T, Values>...>
: public sprout::types::type_tuple<sprout::integral_constant<T, Values>...>
{
public:
typedef integral_array type;
@ -42,7 +42,7 @@ namespace std {
//
template<typename T, T... Values>
struct tuple_size<sprout::types::integral_array<T, Values...> >
: public std::tuple_size<sprout::types::type_tuple<std::integral_constant<T, Values>...> >
: public std::tuple_size<sprout::types::type_tuple<sprout::integral_constant<T, Values>...> >
{};
//
@ -50,7 +50,7 @@ namespace std {
//
template<std::size_t I, typename T, T... Values>
struct tuple_element<I, sprout::types::integral_array<T, Values...> >
: public std::tuple_element<I, sprout::types::type_tuple<std::integral_constant<T, Values>...> >
: public std::tuple_element<I, sprout::types::type_tuple<sprout::integral_constant<T, Values>...> >
{};
#if defined(__clang__)
# pragma clang diagnostic pop

View file

@ -12,6 +12,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type/iterator/next.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace types {
@ -30,7 +31,7 @@ namespace sprout {
std::is_same<First, Last>::value
>::type
>
: public std::integral_constant<std::ptrdiff_t, N>
: public sprout::integral_constant<std::ptrdiff_t, N>
{};
template<typename First, typename Last, std::ptrdiff_t N>
struct distance_impl<

View file

@ -21,7 +21,7 @@ namespace sprout {
//
template<typename Tuple, std::ptrdiff_t Index>
struct index_iterator
: public std::integral_constant<std::ptrdiff_t, Index>
: public sprout::integral_constant<std::ptrdiff_t, Index>
{
public:
typedef typename sprout::types::tuple_element<Index, Tuple>::type type;

View file

@ -16,6 +16,7 @@
#include <sprout/type/tuple.hpp>
#include <sprout/type/seq/algorithm/find_if.hpp>
#include <sprout/type/iterator/distance.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace types {
@ -27,11 +28,11 @@ namespace sprout {
public:
template<typename T, typename Enable = void>
struct apply
: public std::false_type
: public sprout::false_type
{};
template<typename T>
struct apply<T, typename std::enable_if<T::value == 0>::type>
: public std::true_type
: public sprout::true_type
{};
};
template<typename Sequence>

View file

@ -10,12 +10,12 @@
#include <cstddef>
#include <tuple>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type/tuple.hpp>
#include <sprout/type/iterator.hpp>
#include <sprout/type/iterator/index_iterator.hpp>
#include <sprout/type/rebind_types.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace types {
@ -76,7 +76,7 @@ namespace std {
//
template<typename... Types>
struct tuple_size<sprout::types::type_tuple<Types...> >
: public std::integral_constant<std::size_t, sizeof...(Types)>
: public sprout::integral_constant<std::size_t, sizeof...(Types)>
{};
//

View file

@ -9,8 +9,8 @@
#define SPROUT_TYPE_TRAITS_ARITHMETIC_PROMOTE_HPP
#include <utility>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
#include <sprout/type_traits/identity.hpp>
namespace sprout {
@ -20,17 +20,17 @@ namespace sprout {
: public sprout::identity<T>
{
static_assert(
sprout::is_arithmetic<T>::value,
std::is_arithmetic<T>::value,
"arithmetic_promote requires arithmetic types."
);
};
template<typename T, typename U>
struct arithmetic_promote2
: public sprout::decay<decltype(std::declval<T>() + std::declval<U>())>
: public std::decay<decltype(std::declval<T>() + std::declval<U>())>
{
static_assert(
sprout::is_arithmetic<T>::value && sprout::is_arithmetic<U>::value,
std::is_arithmetic<T>::value && std::is_arithmetic<U>::value,
"arithmetic_promote requires arithmetic types."
);
};
@ -56,7 +56,7 @@ namespace sprout {
template<typename... Types>
struct arithmetic_promote
: public sprout::detail::arithmetic_promote_impl<
typename sprout::remove_cv<Types>::type...
typename std::remove_cv<Types>::type...
>
{};

View file

@ -8,8 +8,8 @@
#ifndef SPROUT_TYPE_TRAITS_ENABLER_IF_HPP
#define SPROUT_TYPE_TRAITS_ENABLER_IF_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
namespace sprout {
//
@ -23,7 +23,7 @@ namespace sprout {
//
template<bool C>
class enabler_if
: public sprout::enable_if<C, sprout::enabler_t&>
: public std::enable_if<C, sprout::enabler_t&>
{};
#if SPROUT_USE_TEMPLATE_ALIASES

View file

@ -8,40 +8,40 @@
#ifndef SPROUT_TYPE_TRAITS_FLOAT_PROMOTE_HPP
#define SPROUT_TYPE_TRAITS_FLOAT_PROMOTE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
#include <sprout/type_traits/identity.hpp>
namespace sprout {
namespace detail {
template<typename T>
struct float_promote1
: public sprout::conditional<
sprout::is_floating_point<T>::value,
: public std::conditional<
std::is_floating_point<T>::value,
T,
double
>
{
static_assert(
sprout::is_arithmetic<T>::value,
std::is_arithmetic<T>::value,
"float_promote requires arithmetic type."
);
};
template<typename T, typename U>
struct float_promote2
: public sprout::conditional<
(sprout::is_same<T, long double>::value || sprout::is_same<U, long double>::value),
: public std::conditional<
(std::is_same<T, long double>::value || std::is_same<U, long double>::value),
long double,
typename sprout::conditional<
(sprout::is_same<T, float>::value && sprout::is_same<U, float>::value),
typename std::conditional<
(std::is_same<T, float>::value && std::is_same<U, float>::value),
float,
double
>::type
>
{
static_assert(
sprout::is_arithmetic<T>::value && sprout::is_arithmetic<U>::value,
std::is_arithmetic<T>::value && std::is_arithmetic<U>::value,
"float_promote requires arithmetic type."
);
};
@ -67,7 +67,7 @@ namespace sprout {
template<typename... Types>
struct float_promote
: public sprout::detail::float_promote_impl<
typename sprout::remove_cv<Types>::type...
typename std::remove_cv<Types>::type...
>
{};

View file

@ -11,7 +11,6 @@
#include <sprout/config.hpp>
#include <sprout/preprocessor/cat.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
//
// SPROUT_HAS_XXX_TYPE_DEF

View file

@ -11,9 +11,9 @@
#if defined(_MSC_VER)
# include <cstddef>
#endif
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/preprocessor/cat.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
#include <sprout/type_traits/has_xxx.hpp>
//
@ -27,7 +27,7 @@
template<typename T> \
struct NAME< \
T, \
typename sprout::enable_if<SPROUT_PP_CAT(SPROUT_PP_CAT(sprout_inherit_if_xxx_type_def_impl_has_, TYPE), __LINE__)<T>::value>::type \
typename std::enable_if<SPROUT_PP_CAT(SPROUT_PP_CAT(sprout_inherit_if_xxx_type_def_impl_has_, TYPE), __LINE__)<T>::value>::type \
> { \
public: \
typedef typename T::TYPE ALIAS; \
@ -56,7 +56,7 @@
template<typename T> \
struct NAME< \
T, \
typename sprout::enable_if<SPROUT_PP_CAT(SPROUT_PP_CAT(sprout_inherit_if_xxx_constant_def_impl_has_, CONSTANT), __LINE__)<T>::value>::type \
typename std::enable_if<SPROUT_PP_CAT(SPROUT_PP_CAT(sprout_inherit_if_xxx_constant_def_impl_has_, CONSTANT), __LINE__)<T>::value>::type \
> { \
public: \
SPROUT_STATIC_CONSTEXPR std::size_t ALIAS = T::CONSTANT; \
@ -64,7 +64,7 @@
template<typename T> \
SPROUT_CONSTEXPR_OR_CONST std::size_t NAME< \
T, \
typename sprout::enable_if<SPROUT_PP_CAT(SPROUT_PP_CAT(sprout_inherit_if_xxx_constant_def_impl_has_, CONSTANT), __LINE__)<T>::value>::type \
typename std::enable_if<SPROUT_PP_CAT(SPROUT_PP_CAT(sprout_inherit_if_xxx_constant_def_impl_has_, CONSTANT), __LINE__)<T>::value>::type \
>::ALIAS
#else
#define SPROUT_INHERIT_ALIAS_IF_XXX_CONSTANT_DEF(NAME, ALIAS, CONSTANT) \
@ -74,15 +74,15 @@
template<typename T> \
struct NAME< \
T, \
typename sprout::enable_if<SPROUT_PP_CAT(SPROUT_PP_CAT(sprout_inherit_if_xxx_constant_def_impl_has_, CONSTANT), __LINE__)<T>::value>::type \
typename std::enable_if<SPROUT_PP_CAT(SPROUT_PP_CAT(sprout_inherit_if_xxx_constant_def_impl_has_, CONSTANT), __LINE__)<T>::value>::type \
> { \
public: \
SPROUT_STATIC_CONSTEXPR typename sprout::decay<decltype(T::CONSTANT)>::type ALIAS = T::CONSTANT; \
SPROUT_STATIC_CONSTEXPR typename std::decay<decltype(T::CONSTANT)>::type ALIAS = T::CONSTANT; \
}; \
template<typename T> \
SPROUT_CONSTEXPR_OR_CONST typename sprout::decay<decltype(T::CONSTANT)>::type NAME< \
SPROUT_CONSTEXPR_OR_CONST typename std::decay<decltype(T::CONSTANT)>::type NAME< \
T, \
typename sprout::enable_if<SPROUT_PP_CAT(SPROUT_PP_CAT(sprout_inherit_if_xxx_constant_def_impl_has_, CONSTANT), __LINE__)<T>::value>::type \
typename std::enable_if<SPROUT_PP_CAT(SPROUT_PP_CAT(sprout_inherit_if_xxx_constant_def_impl_has_, CONSTANT), __LINE__)<T>::value>::type \
>::ALIAS
#endif
#define SPROUT_INHERIT_ALIAS_IF_XXX_CONSTANT_DEF_LAZY(ALIAS, CONSTANT) \

View file

@ -34,7 +34,7 @@ namespace sprout {
{};
template<std::size_t N>
struct is_c_str<char[N]>
: public std::true_type
: public sprout::true_type
{};
template<std::size_t N>
struct is_c_str<wchar_t[N]>

View file

@ -1,4 +1,3 @@
#include <sprout/type_traits/std_type_traits.hpp>
/*=============================================================================
Copyright (c) 2011-2013 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
@ -9,9 +8,9 @@
#ifndef SPROUT_TYPE_TRAITS_IS_INT_HPP
#define SPROUT_TYPE_TRAITS_IS_INT_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
namespace sprout {
//
@ -21,7 +20,7 @@ namespace sprout {
struct is_int
: public sprout::integral_constant<
bool,
sprout::is_integral<T>::value && sprout::is_signed<T>::value
std::is_integral<T>::value && std::is_signed<T>::value
>
{};

View file

@ -8,9 +8,9 @@
#ifndef SPROUT_TYPE_TRAITS_IS_UINT_HPP
#define SPROUT_TYPE_TRAITS_IS_UINT_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
namespace sprout {
//
@ -20,7 +20,7 @@ namespace sprout {
struct is_uint
: public sprout::integral_constant<
bool,
sprout::is_integral<T>::value && sprout::is_unsigned<T>::value
std::is_integral<T>::value && std::is_unsigned<T>::value
>
{};

View file

@ -8,8 +8,8 @@
#ifndef SPROUT_TYPE_TRAITS_REMOVE_CVREF_HPP
#define SPROUT_TYPE_TRAITS_REMOVE_CVREF_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
namespace sprout {
//
@ -17,8 +17,8 @@ namespace sprout {
//
template<typename T>
struct remove_cvref
: public sprout::remove_cv<
typename sprout::remove_reference<T>::type
: public std::remove_cv<
typename std::remove_reference<T>::type
>
{};

View file

@ -8,8 +8,8 @@
#ifndef SPROUT_TYPE_TRAITS_REMOVE_SHALLOW_CONST_HPP
#define SPROUT_TYPE_TRAITS_REMOVE_SHALLOW_CONST_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
#include <sprout/type_traits/identity.hpp>
namespace sprout {
@ -22,7 +22,7 @@ namespace sprout {
{};
template<typename T>
struct remove_shallow_const<T const>
: public sprout::conditional<sprout::is_array<T>::value, T const, T>
: public std::conditional<std::is_array<T>::value, T const, T>
{};
#if SPROUT_USE_TEMPLATE_ALIASES

View file

@ -8,8 +8,8 @@
#ifndef SPROUT_TYPE_TRAITS_REMOVE_SHALLOW_CV_HPP
#define SPROUT_TYPE_TRAITS_REMOVE_SHALLOW_CV_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
#include <sprout/type_traits/identity.hpp>
namespace sprout {
@ -22,15 +22,15 @@ namespace sprout {
{};
template<typename T>
struct remove_shallow_cv<T const>
: public sprout::conditional<sprout::is_array<T>::value, T const, T>
: public std::conditional<std::is_array<T>::value, T const, T>
{};
template<typename T>
struct remove_shallow_cv<T volatile>
: public sprout::conditional<sprout::is_array<T>::value, T volatile, T>
: public std::conditional<std::is_array<T>::value, T volatile, T>
{};
template<typename T>
struct remove_shallow_cv<T const volatile>
: public sprout::conditional<sprout::is_array<T>::value, T const volatile, T>
: public std::conditional<std::is_array<T>::value, T const volatile, T>
{};
#if SPROUT_USE_TEMPLATE_ALIASES

View file

@ -8,8 +8,8 @@
#ifndef SPROUT_TYPE_TRAITS_REMOVE_SHALLOW_VOLATILE_HPP
#define SPROUT_TYPE_TRAITS_REMOVE_SHALLOW_VOLATILE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
#include <sprout/type_traits/identity.hpp>
namespace sprout {
@ -22,7 +22,7 @@ namespace sprout {
{};
template<typename T>
struct remove_shallow_volatile<T volatile>
: public sprout::conditional<sprout::is_array<T>::value, T volatile, T>
: public std::conditional<std::is_array<T>::value, T volatile, T>
{};
#if SPROUT_USE_TEMPLATE_ALIASES

View file

@ -335,8 +335,8 @@ namespace sprout {
struct is_trivially_destructible
: public sprout::integral_constant<
bool,
sprout::is_scalar<typename std::remove_all_extents<T>::type>::value
|| sprout::is_reference<typename std::remove_all_extents<T>::type>::value
std::is_scalar<typename std::remove_all_extents<T>::type>::value
|| std::is_reference<typename std::remove_all_extents<T>::type>::value
>
{};
#endif // #if SPROUT_CLANG_HAS_FUTURE(has_trivial_destructor) || SPROUT_GCC_GREATER_EQUAL(4, 3, 0)
@ -379,8 +379,8 @@ namespace sprout {
struct is_nothrow_destructible
: public sprout::integral_constant<
bool,
sprout::is_scalar<typename std::remove_all_extents<T>::type>::value
|| sprout::is_reference<typename std::remove_all_extents<T>::type>::value
std::is_scalar<typename std::remove_all_extents<T>::type>::value
|| std::is_reference<typename std::remove_all_extents<T>::type>::value
>
{};
#else // #if !defined(_LIBCPP_VERSION) && SPROUT_GCC_LESS(4, 8, 0)
@ -460,9 +460,9 @@ namespace sprout {
#if !defined(_LIBCPP_VERSION) || (_LIBCPP_VERSION < 1101)
template<std::size_t Len, typename... Types>
struct aligned_union
: public sprout::aligned_storage<
: public std::aligned_storage<
sprout::tpp::max_element_c<std::size_t, Len, sizeof(Types)...>::value,
sprout::tpp::max_element_c<std::size_t, sprout::alignment_of<Types>::value...>::value
sprout::tpp::max_element_c<std::size_t, std::alignment_of<Types>::value...>::value
>
{};
#else // #if !defined(_LIBCPP_VERSION) || (_LIBCPP_VERSION < 1101)

View file

@ -9,9 +9,9 @@
#define SPROUT_UTILITY_PACK_HPP
#include <cstddef>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/utility/forward.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/enabler_if.hpp>
namespace sprout {
@ -45,7 +45,7 @@ namespace sprout {
//
template<std::size_t I, typename T, T... Args>
struct tppack_c_at
: public sprout::tppack_at<I, std::integral_constant<T, Args>...>::type
: public sprout::tppack_at<I, sprout::integral_constant<T, Args>...>::type
{};
//

View file

@ -9,10 +9,10 @@
#define SPROUT_UTILITY_PAIR_TUPLE_HPP
#include <cstddef>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/utility/pair/pair.hpp>
#include <sprout/utility/move.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace tuples {
@ -66,7 +66,7 @@ namespace std {
//
template<typename T1, typename T2>
struct tuple_size<sprout::pair<T1, T2> >
: public std::integral_constant<std::size_t, 2>
: public sprout::integral_constant<std::size_t, 2>
{};
//

View file

@ -20,6 +20,7 @@
#include <sprout/string/npos.hpp>
#include <sprout/string/string.hpp>
#include <sprout/string/detail/operations.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT
#if SPROUT_USE_INDEX_ITERATOR_IMPLEMENTATION
# include <sprout/iterator/index_iterator.hpp>
@ -53,7 +54,7 @@ namespace sprout {
private:
template<typename Iterator>
class is_string_ref_iterator
: public std::integral_constant<
: public sprout::integral_constant<
bool,
std::is_same<Iterator, sprout::index_iterator<basic_string_ref&, true> >::value
|| std::is_same<Iterator, sprout::index_iterator<basic_string_ref const&, true> >::value

View file

@ -8,9 +8,9 @@
#ifndef SPROUT_UTILITY_STRING_REF_TYPE_TRAITS_HPP
#define SPROUT_UTILITY_STRING_REF_TYPE_TRAITS_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/utility/string_ref/string_ref.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
//
@ -18,7 +18,7 @@ namespace sprout {
//
template<typename T>
struct is_basic_string_ref
: public std::false_type
: public sprout::false_type
{};
template<typename T>
struct is_basic_string_ref<T const>
@ -30,7 +30,7 @@ namespace sprout {
{};
template<typename T, typename Traits>
struct is_basic_string_ref<sprout::basic_string_ref<T, Traits> >
: public std::true_type
: public sprout::true_type
{};
//
@ -38,7 +38,7 @@ namespace sprout {
//
template<typename T, typename Elem>
struct is_string_ref_of
: public std::false_type
: public sprout::false_type
{};
template<typename T, typename Elem>
struct is_string_ref_of<T const, Elem>
@ -50,7 +50,7 @@ namespace sprout {
{};
template<typename T, typename Traits, typename Elem>
struct is_string_ref_of<sprout::basic_string_ref<T, Traits>, Elem>
: public std::true_type
: public sprout::true_type
{};
//

View file

@ -10,11 +10,11 @@
#include <cstddef>
#include <tuple>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/utility/move.hpp>
#include <sprout/tuple/tuple/get.hpp>
#include <sprout/uuid/uuid.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
//
@ -50,7 +50,7 @@ namespace std {
template<>
struct tuple_size<sprout::uuids::uuid> {
public:
typedef std::integral_constant<std::size_t, 16> type;
typedef sprout::integral_constant<std::size_t, 16> type;
SPROUT_STATIC_CONSTEXPR std::size_t value = type::value;
};

View file

@ -8,9 +8,9 @@
#ifndef SPROUT_VARIANT_TYPE_TRAITS_HPP
#define SPROUT_VARIANT_TYPE_TRAITS_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/variant/variant_fwd.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
//
@ -18,7 +18,7 @@ namespace sprout {
//
template<typename T>
struct is_variant
: public std::false_type
: public sprout::false_type
{};
template<typename T>
struct is_variant<T const>
@ -30,7 +30,7 @@ namespace sprout {
{};
template<typename... Types>
struct is_variant<sprout::variant<Types...> >
: public std::true_type
: public sprout::true_type
{};
} // namespace sprout

View file

@ -10,6 +10,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/weed/traits/type/is_tuple.hpp>
namespace sprout {
@ -17,7 +18,7 @@ namespace sprout {
namespace detail {
template<typename T, typename U, typename = void>
struct is_both_tuple
: public std::false_type
: public sprout::false_type
{};
template<typename T, typename U>
struct is_both_tuple<
@ -28,7 +29,7 @@ namespace sprout {
&& sprout::weed::traits::is_tuple<U>::value
>::type
>
: public std::true_type
: public sprout::true_type
{};
} // namespace detail
} // namespace weed

View file

@ -10,6 +10,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/weed/traits/type/is_unused.hpp>
namespace sprout {
@ -17,7 +18,7 @@ namespace sprout {
namespace detail {
template<typename T, typename U, typename = void>
struct is_both_unused
: public std::false_type
: public sprout::false_type
{};
template<typename T, typename U>
struct is_both_unused<
@ -28,7 +29,7 @@ namespace sprout {
&& sprout::weed::traits::is_unused<U>::value
>::type
>
: public std::true_type
: public sprout::true_type
{};
} // namespace detail
} // namespace weed

View file

@ -10,6 +10,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/weed/traits/type/is_container.hpp>
namespace sprout {
@ -17,7 +18,7 @@ namespace sprout {
namespace detail {
template<typename T, typename U, typename = void>
struct is_container_and_elem
: public std::false_type
: public sprout::false_type
{};
template<typename T, typename U>
struct is_container_and_elem<
@ -31,7 +32,7 @@ namespace sprout {
>::value
>::type
>
: public std::true_type
: public sprout::true_type
{};
} // namespace detail
} // namespace weed

View file

@ -10,6 +10,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/weed/traits/type/is_unused.hpp>
#include <sprout/weed/detail/is_same_container.hpp>
#include <sprout/weed/detail/is_container_and_elem.hpp>
@ -23,7 +24,7 @@ namespace sprout {
namespace detail {
template<typename T, typename U, typename = void>
struct is_different_elem
: public std::false_type
: public sprout::false_type
{};
template<typename T, typename U>
struct is_different_elem<
@ -41,7 +42,7 @@ namespace sprout {
&& !sprout::weed::traits::is_unused<U>::value
>::type
>
: public std::true_type
: public sprout::true_type
{};
} // namespace detail
} // namespace weed

View file

@ -10,6 +10,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/weed/traits/type/is_container.hpp>
namespace sprout {
@ -17,7 +18,7 @@ namespace sprout {
namespace detail {
template<typename T, typename U, typename = void>
struct is_elem_and_container
: public std::false_type
: public sprout::false_type
{};
template<typename T, typename U>
struct is_elem_and_container<
@ -31,7 +32,7 @@ namespace sprout {
>::value
>::type
>
: public std::true_type
: public sprout::true_type
{};
} // namespace detail
} // namespace weed

View file

@ -10,6 +10,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/weed/traits/type/is_tuple.hpp>
#include <sprout/weed/traits/type/is_unused.hpp>
@ -18,7 +19,7 @@ namespace sprout {
namespace detail {
template<typename T, typename U, typename = void>
struct is_elem_and_tuple
: public std::false_type
: public sprout::false_type
{};
template<typename T, typename U>
struct is_elem_and_tuple<
@ -30,7 +31,7 @@ namespace sprout {
&& sprout::weed::traits::is_tuple<U>::value
>::type
>
: public std::true_type
: public sprout::true_type
{};
} // namespace detail
} // namespace weed

View file

@ -10,6 +10,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/weed/traits/type/is_unused.hpp>
namespace sprout {
@ -17,7 +18,7 @@ namespace sprout {
namespace detail {
template<typename T, typename U, typename = void>
struct is_elem_and_unused
: public std::false_type
: public sprout::false_type
{};
template<typename T, typename U>
struct is_elem_and_unused<
@ -28,7 +29,7 @@ namespace sprout {
&& sprout::weed::traits::is_unused<U>::value
>::type
>
: public std::true_type
: public sprout::true_type
{};
} // namespace detail
} // namespace weed

View file

@ -10,6 +10,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/weed/traits/type/is_container.hpp>
namespace sprout {
@ -17,7 +18,7 @@ namespace sprout {
namespace detail {
template<typename T, typename U, typename = void>
struct is_same_container
: public std::false_type
: public sprout::false_type
{};
template<typename T, typename U>
struct is_same_container<
@ -32,7 +33,7 @@ namespace sprout {
>::value
>::type
>
: public std::true_type
: public sprout::true_type
{};
} // namespace detail
} // namespace weed

View file

@ -10,6 +10,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/weed/traits/type/is_unused.hpp>
#include <sprout/weed/detail/is_same_container.hpp>
#include <sprout/weed/detail/is_container_and_elem.hpp>
@ -23,7 +24,7 @@ namespace sprout {
namespace detail {
template<typename T, typename U, typename = void>
struct is_same_elem
: public std::false_type
: public sprout::false_type
{};
template<typename T, typename U>
struct is_same_elem<
@ -41,7 +42,7 @@ namespace sprout {
&& !sprout::weed::traits::is_unused<U>::value
>::type
>
: public std::true_type
: public sprout::true_type
{};
} // namespace detail
} // namespace weed

View file

@ -10,6 +10,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/weed/traits/type/is_tuple.hpp>
#include <sprout/weed/traits/type/is_unused.hpp>
@ -18,7 +19,7 @@ namespace sprout {
namespace detail {
template<typename T, typename U, typename = void>
struct is_tuple_and_elem
: public std::false_type
: public sprout::false_type
{};
template<typename T, typename U>
struct is_tuple_and_elem<
@ -30,7 +31,7 @@ namespace sprout {
&& !sprout::weed::traits::is_unused<U>::value
>::type
>
: public std::true_type
: public sprout::true_type
{};
} // namespace detail
} // namespace weed

View file

@ -10,6 +10,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/weed/traits/type/is_unused.hpp>
namespace sprout {
@ -17,7 +18,7 @@ namespace sprout {
namespace detail {
template<typename T, typename U, typename = void>
struct is_unused_and_elem
: public std::false_type
: public sprout::false_type
{};
template<typename T, typename U>
struct is_unused_and_elem<
@ -28,7 +29,7 @@ namespace sprout {
&& !sprout::weed::traits::is_unused<U>::value
>::type
>
: public std::true_type
: public sprout::true_type
{};
} // namespace detail
} // namespace weed

View file

@ -10,6 +10,7 @@
#include <cstddef>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/identity.hpp>
#include <sprout/weed/parser_result.hpp>
#include <sprout/weed/limited.hpp>
@ -91,7 +92,7 @@ namespace sprout {
//
template<typename Parser, std::size_t Limit, typename Iterator, typename Context>
struct limit_of<sprout::weed::limit_p<Parser, Limit>, Iterator, Context>
: public std::integral_constant<std::size_t, Limit>
: public sprout::integral_constant<std::size_t, Limit>
{};
} // namespace traits
} // namespace weed

View file

@ -10,6 +10,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/weed/expr/expr_fwd.hpp>
namespace sprout {
@ -20,7 +21,7 @@ namespace sprout {
//
template<typename T>
struct is_expr
: public std::false_type
: public sprout::false_type
{};
template<typename T>
struct is_expr<T const>
@ -36,7 +37,7 @@ namespace sprout {
{};
template<typename Tag, typename... Args>
struct is_expr<sprout::weed::expr<Tag, Args...> >
: public std::true_type
: public sprout::true_type
{};
} // namespace traits
} // namespace weed

View file

@ -10,6 +10,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/weed/unused.hpp>
#include <sprout/weed/parser/parser_base.hpp>
#include <sprout/weed/traits/type/is_char_type.hpp>
@ -32,7 +33,7 @@ namespace sprout {
&& !std::is_const<T>::value
>::type
>
: public std::true_type
: public sprout::true_type
{};
template<typename T>
struct is_parser<
@ -42,7 +43,7 @@ namespace sprout {
&& !std::is_const<T>::value
>::type
>
: public std::true_type
: public sprout::true_type
{};
template<typename T>
struct is_parser<
@ -52,7 +53,7 @@ namespace sprout {
&& !std::is_const<T>::value
>::type
>
: public std::true_type
: public sprout::true_type
{};
template<typename T>
struct is_parser<
@ -62,7 +63,7 @@ namespace sprout {
&& !std::is_const<T>::value
>::type
>
: public std::true_type
: public sprout::true_type
{};
template<typename T>
struct is_parser<

View file

@ -9,8 +9,8 @@
#define SPROUT_WEED_TRAITS_PARSER_LIMIT_OF_HPP
#include <cstddef>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/weed/expr/expr.hpp>
#include <sprout/weed/expr/tag.hpp>
@ -22,7 +22,7 @@ namespace sprout {
//
template<typename T, typename Iterator, typename Context, typename = void>
struct limit_of
: public std::integral_constant<std::size_t, static_cast<std::size_t>(-1)>
: public sprout::integral_constant<std::size_t, static_cast<std::size_t>(-1)>
{};
template<typename T, typename Iterator, typename Context>
struct limit_of<T const, Iterator, Context>

View file

@ -12,6 +12,7 @@
#include <sprout/config.hpp>
#include <sprout/string.hpp>
#include <sprout/array/array.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace weed {
@ -21,7 +22,7 @@ namespace sprout {
//
template<typename T>
struct is_container
: public std::false_type
: public sprout::false_type
{};
template<typename T>
struct is_container<T const>
@ -37,11 +38,11 @@ namespace sprout {
{};
template<typename T, std::size_t N>
struct is_container<sprout::array<T, N> >
: public std::true_type
: public sprout::true_type
{};
template<typename T, std::size_t N, typename Traits>
struct is_container<sprout::basic_string<T, N, Traits> >
: public std::true_type
: public sprout::true_type
{};
} // namespace traits
} // namespace weed

View file

@ -11,6 +11,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/string.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace weed {
@ -20,7 +21,7 @@ namespace sprout {
//
template<typename T>
struct is_string
: public std::false_type
: public sprout::false_type
{};
template<typename T>
struct is_string<T const>
@ -36,7 +37,7 @@ namespace sprout {
{};
template<typename T, std::size_t N, typename Traits>
struct is_string<sprout::basic_string<T, N, Traits> >
: public std::true_type
: public sprout::true_type
{};
} // namespace traits
} // namespace weed

View file

@ -11,6 +11,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/tuple/tuple.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
namespace weed {
@ -20,7 +21,7 @@ namespace sprout {
//
template<typename T>
struct is_tuple
: public std::false_type
: public sprout::false_type
{};
template<typename T>
struct is_tuple<T const>
@ -36,7 +37,7 @@ namespace sprout {
{};
template<typename... Types>
struct is_tuple<sprout::tuples::tuple<Types...> >
: public std::true_type
: public sprout::true_type
{};
} // namespace traits
} // namespace weed

View file

@ -10,6 +10,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/weed/unused.hpp>
namespace sprout {
@ -20,7 +21,7 @@ namespace sprout {
//
template<typename T>
struct is_unused
: public std::false_type
: public sprout::false_type
{};
template<typename T>
struct is_unused<T const>
@ -36,7 +37,7 @@ namespace sprout {
{};
template<>
struct is_unused<sprout::weed::unused>
: public std::true_type
: public sprout::true_type
{};
} // namespace traits
} // namespace weed