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

add bool_constant [N4334]

This commit is contained in:
bolero-MURAKAMI 2014-12-10 19:54:12 +09:00
parent fbb95d9068
commit a1f6d6ffc3
35 changed files with 198 additions and 106 deletions

View file

@ -202,16 +202,14 @@ namespace sprout {
public:
template<typename T>
struct apply
: public sprout::integral_constant<
bool,
: public sprout::bool_constant<
(sprout::is_variadic_placeholder<T>::value > 0)
>
{};
};
template<typename Bounds, typename = void>
struct is_variadic_bounds
: public sprout::integral_constant<
bool,
: public sprout::bool_constant<
sprout::types::contains_if<Bounds, sprout::detail::is_variadic_placeholder_pred>::value
>
{};
@ -297,8 +295,7 @@ namespace sprout {
template<sprout::index_t I, typename Bounds, std::size_t ArgSize>
struct is_variadic_part
: public sprout::integral_constant<
bool,
: public sprout::bool_constant<
(sprout::is_variadic_placeholder<
typename sprout::tuples::tuple_element<
sprout::detail::bound_position<I, Bounds, ArgSize>::value,

View file

@ -21,16 +21,14 @@ namespace sprout {
namespace hash_detail {
template<typename T>
struct is_basic_number
: public sprout::integral_constant<
bool,
: public sprout::bool_constant<
std::is_integral<T>::value
&& (sizeof(T) <= sizeof(std::size_t))
>
{};
template<typename T>
struct is_long_number
: public sprout::integral_constant<
bool,
: public sprout::bool_constant<
std::is_integral<T>::value
&& (sizeof(T) > sizeof(std::size_t))
&& std::is_signed<T>::value
@ -38,8 +36,7 @@ namespace sprout {
{};
template<typename T>
struct is_ulong_number
: public sprout::integral_constant<
bool,
: public sprout::bool_constant<
std::is_integral<T>::value
&& (sizeof(T) > sizeof(std::size_t))
&& std::is_unsigned<T>::value

View file

@ -19,16 +19,14 @@ namespace sprout {
//
template<typename Fn>
struct is_strict_unary_function
: public sprout::integral_constant<
bool,
: public sprout::bool_constant<
sprout::has_result_type<Fn>::value
&& sprout::has_argument_type<Fn>::value
>
{};
template<typename Fn>
struct is_strict_binary_function
: public sprout::integral_constant<
bool,
: public sprout::bool_constant<
sprout::has_result_type<Fn>::value
&& sprout::has_first_argument_type<Fn>::value
&& sprout::has_second_argument_type<Fn>::value
@ -39,8 +37,7 @@ namespace sprout {
//
template<typename Fn>
struct is_strict_function
: public sprout::integral_constant<
bool,
: public sprout::bool_constant<
sprout::is_strict_unary_function<Fn>::value
|| sprout::is_strict_binary_function<Fn>::value
>