add has_operator type_traits

This commit is contained in:
bolero-MURAKAMI 2016-04-06 19:24:26 +09:00
parent b0f446c959
commit 35305c18fb
73 changed files with 1597 additions and 118 deletions

View file

@ -9,9 +9,9 @@
#define SPROUT_FUNCTIONAL_INC_DEC_HPP
#include <sprout/config.hpp>
#include <sprout/functional/pre_inc.hpp>
#include <sprout/functional/pre_dec.hpp>
#include <sprout/functional/post_inc.hpp>
#include <sprout/functional/post_dec.hpp>
#include <sprout/functional/pre_increment.hpp>
#include <sprout/functional/pre_decrement.hpp>
#include <sprout/functional/post_increment.hpp>
#include <sprout/functional/post_decrement.hpp>
#endif // #ifndef SPROUT_FUNCTIONAL_INC_DEC_HPP

View file

@ -5,8 +5,8 @@
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_FUNCTIONAL_MEM_PTR_HPP
#define SPROUT_FUNCTIONAL_MEM_PTR_HPP
#ifndef SPROUT_FUNCTIONAL_MEMBER_POINTER_HPP
#define SPROUT_FUNCTIONAL_MEMBER_POINTER_HPP
#include <utility>
#include <sprout/config.hpp>
@ -15,12 +15,12 @@
namespace sprout {
//
// mem_ptr
// member_pointer
//
template<typename T = void>
struct mem_ptr;
struct member_pointer;
template<>
struct mem_ptr<void>
struct member_pointer<void>
: public sprout::transparent<>
{
public:
@ -34,4 +34,4 @@ namespace sprout {
};
} // namespace sprout
#endif // #ifndef SPROUT_FUNCTIONAL_MEM_PTR_HPP
#endif // #ifndef SPROUT_FUNCTIONAL_MEMBER_POINTER_HPP

View file

@ -9,7 +9,7 @@
#define SPROUT_FUNCTIONAL_MEMBERS_HPP
#include <sprout/config.hpp>
#include <sprout/functional/mem_ptr.hpp>
#include <sprout/functional/member_pointer.hpp>
#include <sprout/functional/member.hpp>
#endif // #ifndef SPROUT_FUNCTIONAL_MEMBERS_HPP

View file

@ -9,9 +9,9 @@
#define SPROUT_FUNCTIONAL_POLYMORPHIC_INC_DEC_HPP
#include <sprout/config.hpp>
#include <sprout/functional/polymorphic/pre_inc.hpp>
#include <sprout/functional/polymorphic/pre_dec.hpp>
#include <sprout/functional/polymorphic/post_inc.hpp>
#include <sprout/functional/polymorphic/post_dec.hpp>
#include <sprout/functional/polymorphic/pre_increment.hpp>
#include <sprout/functional/polymorphic/pre_decrement.hpp>
#include <sprout/functional/polymorphic/post_increment.hpp>
#include <sprout/functional/polymorphic/post_decrement.hpp>
#endif // #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_INC_DEC_HPP

View file

@ -5,21 +5,21 @@
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_FUNCTIONAL_POLYMORPHIC_POST_DEC_HPP
#define SPROUT_FUNCTIONAL_POLYMORPHIC_POST_DEC_HPP
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_MEMBER_POINTER_HPP
#define SPROUT_FUNCTIONAL_POLYMORPHIC_MEMBER_POINTER_HPP
#include <sprout/config.hpp>
#include <sprout/functional/post_dec.hpp>
#include <sprout/functional/member_pointer.hpp>
namespace sprout {
//
// post_dec_t
// post_dec_
// member_pointer_t
// member_pointer_
//
typedef sprout::post_dec<> post_dec_t;
typedef sprout::member_pointer<> member_pointer_t;
namespace {
SPROUT_STATIC_CONSTEXPR sprout::post_dec_t post_dec_ = {};
SPROUT_STATIC_CONSTEXPR sprout::member_pointer_t member_pointer_ = {};
} // anonymous-namespace
} // namespace sprout
#endif // #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_POST_DEC_HPP
#endif // #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_MEMBER_POINTER_HPP

View file

@ -9,7 +9,7 @@
#define SPROUT_FUNCTIONAL_POLYMORPHIC_MEMBERS_HPP
#include <sprout/config.hpp>
#include <sprout/functional/polymorphic/mem_ptr.hpp>
#include <sprout/functional/polymorphic/member_pointer.hpp>
#include <sprout/functional/polymorphic/member.hpp>
#endif // #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_MEMBERS_HPP

View file

@ -5,21 +5,21 @@
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_FUNCTIONAL_POLYMORPHIC_POST_INC_HPP
#define SPROUT_FUNCTIONAL_POLYMORPHIC_POST_INC_HPP
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_POST_DECREMENT_HPP
#define SPROUT_FUNCTIONAL_POLYMORPHIC_POST_DECREMENT_HPP
#include <sprout/config.hpp>
#include <sprout/functional/post_inc.hpp>
#include <sprout/functional/post_decrement.hpp>
namespace sprout {
//
// post_inc_t
// post_inc_
// post_decrement_t
// post_decrement_
//
typedef sprout::post_inc<> post_inc_t;
typedef sprout::post_decrement<> post_decrement_t;
namespace {
SPROUT_STATIC_CONSTEXPR sprout::post_inc_t post_inc_ = {};
SPROUT_STATIC_CONSTEXPR sprout::post_decrement_t post_decrement_ = {};
} // anonymous-namespace
} // namespace sprout
#endif // #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_POST_INC_HPP
#endif // #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_POST_DECREMENT_HPP

View file

@ -0,0 +1,25 @@
/*=============================================================================
Copyright (c) 2011-2016 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_FUNCTIONAL_POLYMORPHIC_POST_INCREMENT_HPP
#define SPROUT_FUNCTIONAL_POLYMORPHIC_POST_INCREMENT_HPP
#include <sprout/config.hpp>
#include <sprout/functional/post_increment.hpp>
namespace sprout {
//
// post_increment_t
// post_increment_
//
typedef sprout::post_increment<> post_increment_t;
namespace {
SPROUT_STATIC_CONSTEXPR sprout::post_increment_t post_increment_ = {};
} // anonymous-namespace
} // namespace sprout
#endif // #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_POST_INCREMENT_HPP

View file

@ -5,21 +5,21 @@
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_FUNCTIONAL_POLYMORPHIC_PRE_DEC_HPP
#define SPROUT_FUNCTIONAL_POLYMORPHIC_PRE_DEC_HPP
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_PRE_DECREMENT_HPP
#define SPROUT_FUNCTIONAL_POLYMORPHIC_PRE_DECREMENT_HPP
#include <sprout/config.hpp>
#include <sprout/functional/pre_dec.hpp>
#include <sprout/functional/pre_decrement.hpp>
namespace sprout {
//
// pre_dec_t
// pre_dec_
// pre_decrement_t
// pre_decrement_
//
typedef sprout::pre_dec<> pre_dec_t;
typedef sprout::pre_decrement<> pre_decrement_t;
namespace {
SPROUT_STATIC_CONSTEXPR sprout::pre_dec_t pre_dec_ = {};
SPROUT_STATIC_CONSTEXPR sprout::pre_decrement_t pre_decrement_ = {};
} // anonymous-namespace
} // namespace sprout
#endif // #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_PRE_DEC_HPP
#endif // #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_PRE_DECREMENT_HPP

View file

@ -1,25 +0,0 @@
/*=============================================================================
Copyright (c) 2011-2016 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_FUNCTIONAL_POLYMORPHIC_PRE_INC_HPP
#define SPROUT_FUNCTIONAL_POLYMORPHIC_PRE_INC_HPP
#include <sprout/config.hpp>
#include <sprout/functional/pre_inc.hpp>
namespace sprout {
//
// pre_inc_t
// pre_inc_
//
typedef sprout::pre_inc<> pre_inc_t;
namespace {
SPROUT_STATIC_CONSTEXPR sprout::pre_inc_t pre_inc_ = {};
} // anonymous-namespace
} // namespace sprout
#endif // #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_PRE_INC_HPP

View file

@ -5,21 +5,21 @@
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_FUNCTIONAL_POLYMORPHIC_MEM_PTR_HPP
#define SPROUT_FUNCTIONAL_POLYMORPHIC_MEM_PTR_HPP
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_PRE_INCREMENT_HPP
#define SPROUT_FUNCTIONAL_POLYMORPHIC_PRE_INCREMENT_HPP
#include <sprout/config.hpp>
#include <sprout/functional/mem_ptr.hpp>
#include <sprout/functional/pre_increment.hpp>
namespace sprout {
//
// mem_ptr_t
// mem_ptr_
// pre_increment_t
// pre_increment_
//
typedef sprout::mem_ptr<> mem_ptr_t;
typedef sprout::pre_increment<> pre_increment_t;
namespace {
SPROUT_STATIC_CONSTEXPR sprout::mem_ptr_t mem_ptr_ = {};
SPROUT_STATIC_CONSTEXPR sprout::pre_increment_t pre_increment_ = {};
} // anonymous-namespace
} // namespace sprout
#endif // #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_MEM_PTR_HPP
#endif // #ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_PRE_INCREMENT_HPP

View file

@ -5,8 +5,8 @@
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_FUNCTIONAL_POST_DEC_HPP
#define SPROUT_FUNCTIONAL_POST_DEC_HPP
#ifndef SPROUT_FUNCTIONAL_POST_DECREMENT_HPP
#define SPROUT_FUNCTIONAL_POST_DECREMENT_HPP
#include <utility>
#include <sprout/config.hpp>
@ -15,23 +15,23 @@
namespace sprout {
//
// post_dec
// post_decrement
//
template<typename T = void>
struct post_dec;
struct post_decrement;
template<>
struct post_dec<void>
struct post_decrement<void>
: public sprout::transparent<>
{
public:
template<typename T>
SPROUT_CONSTEXPR decltype(~std::declval<T>()--)
SPROUT_CONSTEXPR decltype(std::declval<T>()--)
operator()(T&& x)
const SPROUT_NOEXCEPT_IF_EXPR(~std::declval<T>()--)
const SPROUT_NOEXCEPT_IF_EXPR(std::declval<T>()--)
{
return SPROUT_FORWARD(T, x)--;
}
};
} // namespace sprout
#endif // #ifndef SPROUT_FUNCTIONAL_POST_DEC_HPP
#endif // #ifndef SPROUT_FUNCTIONAL_POST_DECREMENT_HPP

View file

@ -5,8 +5,8 @@
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_FUNCTIONAL_POST_INC_HPP
#define SPROUT_FUNCTIONAL_POST_INC_HPP
#ifndef SPROUT_FUNCTIONAL_POST_INCREMENT_HPP
#define SPROUT_FUNCTIONAL_POST_INCREMENT_HPP
#include <utility>
#include <sprout/config.hpp>
@ -15,12 +15,12 @@
namespace sprout {
//
// post_inc
// post_increment
//
template<typename T = void>
struct post_inc;
struct post_increment;
template<>
struct post_inc<void>
struct post_increment<void>
: public sprout::transparent<>
{
public:
@ -34,4 +34,4 @@ namespace sprout {
};
} // namespace sprout
#endif // #ifndef SPROUT_FUNCTIONAL_POST_INC_HPP
#endif // #ifndef SPROUT_FUNCTIONAL_POST_INCREMENT_HPP

View file

@ -5,8 +5,8 @@
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_FUNCTIONAL_PRE_DEC_HPP
#define SPROUT_FUNCTIONAL_PRE_DEC_HPP
#ifndef SPROUT_FUNCTIONAL_PRE_DECREMENT_HPP
#define SPROUT_FUNCTIONAL_PRE_DECREMENT_HPP
#include <utility>
#include <sprout/config.hpp>
@ -15,12 +15,12 @@
namespace sprout {
//
// pre_dec
// pre_decrement
//
template<typename T = void>
struct pre_dec;
struct pre_decrement;
template<>
struct pre_dec<void>
struct pre_decrement<void>
: public sprout::transparent<>
{
public:
@ -34,4 +34,4 @@ namespace sprout {
};
} // namespace sprout
#endif // #ifndef SPROUT_FUNCTIONAL_PRE_DEC_HPP
#endif // #ifndef SPROUT_FUNCTIONAL_PRE_DECREMENT_HPP

View file

@ -5,8 +5,8 @@
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_FUNCTIONAL_PRE_INC_HPP
#define SPROUT_FUNCTIONAL_PRE_INC_HPP
#ifndef SPROUT_FUNCTIONAL_PRE_INCREMENT_HPP
#define SPROUT_FUNCTIONAL_PRE_INCREMENT_HPP
#include <utility>
#include <sprout/config.hpp>
@ -15,12 +15,12 @@
namespace sprout {
//
// pre_inc
// pre_increment
//
template<typename T = void>
struct pre_inc;
struct pre_increment;
template<>
struct pre_inc<void>
struct pre_increment<void>
: public sprout::transparent<>
{
public:
@ -34,4 +34,4 @@ namespace sprout {
};
} // namespace sprout
#endif // #ifndef SPROUT_FUNCTIONAL_PRE_INC_HPP
#endif // #ifndef SPROUT_FUNCTIONAL_PRE_INCREMENT_HPP

View file

@ -0,0 +1,18 @@
/*=============================================================================
Copyright (c) 2011-2016 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_PREPROCESSOR_COMMA_HPP
#define SPROUT_PREPROCESSOR_COMMA_HPP
#include <sprout/config.hpp>
//
// SPROUT_PP_COMMA
//
#define SPROUT_PP_COMMA() ,
#endif // #ifndef SPROUT_PREPROCESSOR_COMMA_HPP

View file

@ -22,7 +22,7 @@ namespace sprout {
{};
template<typename T, typename U>
struct copy_const<T, U volatile>
: public std::add_volatile<T>
: public std::add_const<T>
{};
#if SPROUT_USE_TEMPLATE_ALIASES

View file

@ -16,13 +16,19 @@
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/preprocessor/cat.hpp>
#define SPROUT_DETAIL_HAS_BINARY_OP_DECL(OP_NAME, OP) \
#define SPROUT_DETAIL_HAS_BINARY_OP_INFIX_EXPR(OP, LHS, RHS) \
LHS OP RHS
#define SPROUT_DETAIL_HAS_BINARY_OP_DECL(OP_NAME, OP, RHS_DEFAULT) \
SPROUT_DETAIL_HAS_BINARY_OP_DECL_(OP_NAME, OP, RHS_DEFAULT, SPROUT_DETAIL_HAS_BINARY_OP_INFIX_EXPR)
#define SPROUT_DETAIL_HAS_BINARY_OP_DECL_(OP_NAME, OP, RHS_DEFAULT, EXPR) \
template<typename T1, typename T2, typename R> \
struct SPROUT_PP_CAT(sprout_detail_has_, SPROUT_PP_CAT(OP_NAME, _test)) { \
public: \
template< \
typename U1 = T1, typename U2 = T2, \
typename Result = sprout::bool_constant<std::is_convertible<typename sprout::identity<decltype(std::declval<U1>() OP std::declval<U2>())>::type, R>::value> \
typename Result = sprout::bool_constant<std::is_convertible<typename sprout::identity<decltype(EXPR(OP, std::declval<U1>(), std::declval<U2>()))>::type, R>::value> \
> \
static Result test(int); \
static sprout::false_type test(...); \
@ -32,20 +38,23 @@
public: \
template< \
typename U1 = T1, typename U2 = T2, \
typename typename sprout::identity<decltype(std::declval<U1>() OP std::declval<U2>())>::type \
typename = typename sprout::identity<decltype(EXPR(OP, std::declval<U1>(), std::declval<U2>()))>::type \
> \
static sprout::true_type test(int); \
static sprout::false_type test(...); \
}; \
SPROUT_DETAIL_HAS_BINARY_OP_DECL_IMPL(OP_NAME); \
template<typename T, typename U, typename R = sprout::dont_care> \
template<typename T, typename U RHS_DEFAULT, typename R = sprout::dont_care> \
struct SPROUT_PP_CAT(has_, OP_NAME) \
: public SPROUT_PP_CAT(sprout_detail_has_, OP_NAME)<T, U, R> \
{}
#if defined(_MSC_VER) && (_MSC_VER > 1900)
# define SPROUT_DETAIL_HAS_BINARY_OP_DECL_IMPL(OP_NAME) \
template<typename T, typename U, typename R, typename Base_ = typename sprout::identity<decltype(SPROUT_PP_CAT(sprout_detail_has_, OP_NAME)<T, U, R>::test(0))>::type> \
template< \
typename T, typename U, typename R, \
typename Base_ = typename sprout::identity<decltype(SPROUT_PP_CAT(sprout_detail_has_, SPROUT_PP_CAT(OP_NAME, _test))<T, U, R>::test(0))>::type \
> \
struct SPROUT_PP_CAT(sprout_detail_has_, OP_NAME) \
: public Base_ \
{}
@ -53,7 +62,7 @@
# define SPROUT_DETAIL_HAS_BINARY_OP_DECL_IMPL(OP_NAME) \
template<typename T, typename U, typename R> \
struct SPROUT_PP_CAT(sprout_detail_has_, OP_NAME) \
: public sprout::identity<decltype(SPROUT_PP_CAT(sprout_detail_has_, OP_NAME)<T, U, R>::test(0))>::type \
: public sprout::identity<decltype(SPROUT_PP_CAT(sprout_detail_has_, SPROUT_PP_CAT(OP_NAME, _test))<T, U, R>::test(0))>::type \
{}
#endif

View file

@ -32,7 +32,7 @@
public: \
template< \
typename U = T, \
typename typename sprout::identity<decltype(std::declval<U>() OP)>::type \
typename = typename sprout::identity<decltype(std::declval<U>() OP)>::type \
> \
static sprout::true_type test(int); \
static sprout::false_type test(...); \
@ -45,7 +45,10 @@
#if defined(_MSC_VER) && (_MSC_VER > 1900)
# define SPROUT_DETAIL_HAS_POST_UNARY_OP_DECL_IMPL(OP_NAME) \
template<typename T, typename R, typename Base_ = typename sprout::identity<decltype(SPROUT_PP_CAT(sprout_detail_has_, OP_NAME)<T, R>::test(0))>::type> \
template< \
typename T, typename R, \
typename Base_ = typename sprout::identity<decltype(SPROUT_PP_CAT(sprout_detail_has_, SPROUT_PP_CAT(OP_NAME, _test))<T, R>::test(0))>::type \
> \
struct SPROUT_PP_CAT(sprout_detail_has_, OP_NAME) \
: public Base_ \
{}
@ -53,7 +56,7 @@
# define SPROUT_DETAIL_HAS_POST_UNARY_OP_DECL_IMPL(OP_NAME) \
template<typename T, typename R> \
struct SPROUT_PP_CAT(sprout_detail_has_, OP_NAME) \
: public sprout::identity<decltype(SPROUT_PP_CAT(sprout_detail_has_, OP_NAME)<T, R>::test(0))>::type \
: public sprout::identity<decltype(SPROUT_PP_CAT(sprout_detail_has_, SPROUT_PP_CAT(OP_NAME, _test))<T, R>::test(0))>::type \
{}
#endif

View file

@ -32,7 +32,7 @@
public: \
template< \
typename U = T, \
typename typename sprout::identity<decltype(OP std::declval<U>())>::type \
typename = typename sprout::identity<decltype(OP std::declval<U>())>::type \
> \
static sprout::true_type test(int); \
static sprout::false_type test(...); \
@ -45,7 +45,10 @@
#if defined(_MSC_VER) && (_MSC_VER > 1900)
# define SPROUT_DETAIL_HAS_PRE_UNARY_OP_DECL_IMPL(OP_NAME) \
template<typename T, typename R, typename Base_ = typename sprout::identity<decltype(SPROUT_PP_CAT(sprout_detail_has_, OP_NAME)<T, R>::test(0))>::type> \
template< \
typename T, typename R, \
typename Base_ = typename sprout::identity<decltype(SPROUT_PP_CAT(sprout_detail_has_, SPROUT_PP_CAT(OP_NAME, _test))<T, R>::test(0))>::type \
> \
struct SPROUT_PP_CAT(sprout_detail_has_, OP_NAME) \
: public Base_ \
{}
@ -53,7 +56,7 @@
# define SPROUT_DETAIL_HAS_PRE_UNARY_OP_DECL_IMPL(OP_NAME) \
template<typename T, typename R> \
struct SPROUT_PP_CAT(sprout_detail_has_, OP_NAME) \
: public sprout::identity<decltype(SPROUT_PP_CAT(sprout_detail_has_, OP_NAME)<T, R>::test(0))>::type \
: public sprout::identity<decltype(SPROUT_PP_CAT(sprout_detail_has_, SPROUT_PP_CAT(OP_NAME, _test))<T, R>::test(0))>::type \
{}
#endif

View file

@ -0,0 +1,21 @@
/*=============================================================================
Copyright (c) 2011-2016 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_DETAIL_HAS_SUBSCRIPT_OP_HPP
#define SPROUT_TYPE_TRAITS_DETAIL_HAS_SUBSCRIPT_OP_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
#define SPROUT_DETAIL_HAS_OP_SUBSCRIPT_EXPR(OP, LHS, RHS) \
LHS[RHS]
#define SPROUT_DETAIL_HAS_SUBSCRIPT_OP_DECL(OP_NAME, OP, RHS_DEFAULT) \
SPROUT_DETAIL_HAS_BINARY_OP_DECL_(OP_NAME, OP, RHS_DEFAULT, SPROUT_DETAIL_HAS_OP_SUBSCRIPT_EXPR)
#endif // #ifndef SPROUT_TYPE_TRAITS_DETAIL_HAS_SUBSCRIPT_OP_HPP

View file

@ -17,15 +17,24 @@ namespace sprout {
// enabler
//
typedef void* enabler_t;
#if defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)
namespace {
SPROUT_STATIC_CONSTEXPR sprout::enabler_t enabler = {};
} // anonymous-namespace
#else
extern enabler_t enabler;
#endif
//
// enabler_if
//
template<bool C>
class enabler_if
#if defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)
: public std::enable_if<C, sprout::enabler_t>
#else
: public std::enable_if<C, sprout::enabler_t&>
#endif
{};
//
// disabler_if

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_ADDRESS_OF_HPP
#define SPROUT_TYPE_TRAITS_HAS_ADDRESS_OF_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_pre_unary_op.hpp>
namespace sprout {
//
// has_address_of
//
SPROUT_DETAIL_HAS_PRE_UNARY_OP_DECL(address_of, &);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_address_of_v = sprout::has_address_of<T, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_ADDRESS_OF_HPP

View file

@ -8,19 +8,19 @@
#ifndef SPROUT_TYPE_TRAITS_HAS_ASSIGN_HPP
#define SPROUT_TYPE_TRAITS_HAS_ASSIGN_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/const_reference.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_assign
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(has_assign, =);
SPROUT_DETAIL_HAS_BINARY_OP_DECL(assign, =, = typename sprout::const_reference<T>::type);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U, typename R = sprout::dont_care>
template<typename T, typename U = typename sprout::const_reference<T>::type, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_assign_v = sprout::has_assign<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_BIT_AND_HPP
#define SPROUT_TYPE_TRAITS_HAS_BIT_AND_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_bit_and
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(bit_and, &, = T);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_bit_and_v = sprout::has_bit_and<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_BIT_AND_HPP

View file

@ -0,0 +1,28 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_BIT_AND_ASSIGN_HPP
#define SPROUT_TYPE_TRAITS_HAS_BIT_AND_ASSIGN_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/const_reference.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_bit_and_assign
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(bit_and_assign, =, = typename sprout::const_reference<T>::type);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = typename sprout::const_reference<T>::type, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_bit_and_assign_v = sprout::has_bit_and_assign<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_BIT_AND_ASSIGN_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_BIT_NOT_HPP
#define SPROUT_TYPE_TRAITS_HAS_BIT_NOT_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_pre_unary_op.hpp>
namespace sprout {
//
// has_bit_not
//
SPROUT_DETAIL_HAS_PRE_UNARY_OP_DECL(bit_not, ~);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_bit_not_v = sprout::has_bit_not<T, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_BIT_NOT_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_BIT_OR_HPP
#define SPROUT_TYPE_TRAITS_HAS_BIT_OR_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_bit_or
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(bit_or, |, = T);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_bit_or_v = sprout::has_bit_or<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_BIT_OR_HPP

View file

@ -0,0 +1,28 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_BIT_OR_ASSIGN_HPP
#define SPROUT_TYPE_TRAITS_HAS_BIT_OR_ASSIGN_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/const_reference.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_bit_or_assign
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(bit_or_assign, =, = typename sprout::const_reference<T>::type);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = typename sprout::const_reference<T>::type, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_bit_or_assign_v = sprout::has_bit_or_assign<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_BIT_OR_ASSIGN_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_BIT_XOR_HPP
#define SPROUT_TYPE_TRAITS_HAS_BIT_XOR_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_bit_xor
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(bit_xor, ^, = T);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_bit_xor_v = sprout::has_bit_xor<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_BIT_XOR_HPP

View file

@ -0,0 +1,28 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_BIT_XOR_ASSIGN_HPP
#define SPROUT_TYPE_TRAITS_HAS_BIT_XOR_ASSIGN_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/const_reference.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_bit_xor_assign
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(bit_xor_assign, =, = typename sprout::const_reference<T>::type);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = typename sprout::const_reference<T>::type, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_bit_xor_assign_v = sprout::has_bit_xor_assign<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_BIT_XOR_ASSIGN_HPP

View file

@ -0,0 +1,28 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_PLUS_HPP
#define SPROUT_TYPE_TRAITS_HAS_PLUS_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
#include <sprout/preprocessor/comma.hpp>
namespace sprout {
//
// has_comma
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(comma, SPROUT_PP_COMMA(), = T);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_comma_v = sprout::has_comma<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_PLUS_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_COMPLEMENT_HPP
#define SPROUT_TYPE_TRAITS_HAS_COMPLEMENT_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/has_bit_not.hpp>
namespace sprout {
//
// has_complement
//
template<typename T, typename R = sprout::dont_care>
struct has_complement
: public sprout::has_bit_not<T, R>
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_complement_v = sprout::has_complement<T, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_COMPLEMENT_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_DEREFERENCE_HPP
#define SPROUT_TYPE_TRAITS_HAS_DEREFERENCE_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_pre_unary_op.hpp>
namespace sprout {
//
// has_dereference
//
SPROUT_DETAIL_HAS_PRE_UNARY_OP_DECL(dereference, *);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_dereference_v = sprout::has_dereference<T, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_DEREFERENCE_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_DIVIDES_HPP
#define SPROUT_TYPE_TRAITS_HAS_DIVIDES_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_divides
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(divides, /, = T);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_divides_v = sprout::has_divides<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_DIVIDES_HPP

View file

@ -0,0 +1,28 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_DIVIDES_ASSIGN_HPP
#define SPROUT_TYPE_TRAITS_HAS_DIVIDES_ASSIGN_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/const_reference.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_divides_assign
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(divides_assign, /=, = typename sprout::const_reference<T>::type);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = typename sprout::const_reference<T>::type, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_divides_assign_v = sprout::has_divides_assign<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_DIVIDES_ASSIGN_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_EQUAL_TO_HPP
#define SPROUT_TYPE_TRAITS_HAS_EQUAL_TO_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_equal_to
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(equal_to, ==, = T);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_equal_to_v = sprout::has_equal_to<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_EQUAL_TO_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_GREATER_HPP
#define SPROUT_TYPE_TRAITS_HAS_GREATER_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_greater
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(greater, >, = T);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_greater_v = sprout::has_greater<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_GREATER_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_GREATER_EQUAL_HPP
#define SPROUT_TYPE_TRAITS_HAS_GREATER_EQUAL_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_greater_equal
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(greater_equal, >=, = T);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_greater_equal_v = sprout::has_greater_equal<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_GREATER_EQUAL_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_LEFT_SHIFT_HPP
#define SPROUT_TYPE_TRAITS_HAS_LEFT_SHIFT_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/has_shift_left.hpp>
namespace sprout {
//
// has_left_shift
//
template<typename T, typename U = T, typename R = sprout::dont_care>
struct has_left_shift
: public sprout::has_shift_left<T, U, R>
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_left_shift_v = sprout::has_left_shift<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_LEFT_SHIFT_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_SHIFT_LEFT_ASSIGN_HPP
#define SPROUT_TYPE_TRAITS_HAS_SHIFT_LEFT_ASSIGN_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/has_shift_left_assign.hpp>
namespace sprout {
//
// has_left_shift_assign
//
template<typename T, typename U = typename sprout::const_reference<T>::type, typename R = sprout::dont_care>
struct has_left_shift_assign
: public sprout::has_shift_left<T, U, R>
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = typename sprout::const_reference<T>::type, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_left_shift_assign_v = sprout::has_left_shift_assign<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_SHIFT_LEFT_ASSIGN_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_LESS_HPP
#define SPROUT_TYPE_TRAITS_HAS_LESS_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_less
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(less, <, = T);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_less_v = sprout::has_less<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_LESS_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_LESS_EQUAL_HPP
#define SPROUT_TYPE_TRAITS_HAS_LESS_EQUAL_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_less_equal
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(less_equal, <=, = T);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_less_equal_v = sprout::has_less_equal<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_LESS_EQUAL_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_LOGICAL_AND_HPP
#define SPROUT_TYPE_TRAITS_HAS_LOGICAL_AND_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_logical_and
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(logical_and, &&, = T);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_logical_and_v = sprout::has_logical_and<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_LOGICAL_AND_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_LOGICAL_NOT_HPP
#define SPROUT_TYPE_TRAITS_HAS_LOGICAL_NOT_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_pre_unary_op.hpp>
namespace sprout {
//
// has_logical_not
//
SPROUT_DETAIL_HAS_PRE_UNARY_OP_DECL(logical_not, !);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_logical_not_v = sprout::has_logical_not<T, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_LOGICAL_NOT_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_LOGICAL_OR_HPP
#define SPROUT_TYPE_TRAITS_HAS_LOGICAL_OR_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_logical_or
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(logical_or, ||, = T);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_logical_or_v = sprout::has_logical_or<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_LOGICAL_OR_HPP

View file

@ -0,0 +1,28 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_MEMBER_HPP
#define SPROUT_TYPE_TRAITS_HAS_MEMBER_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
#include <sprout/preprocessor/empty.hpp>
namespace sprout {
//
// has_member
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(member, .*, SPROUT_PP_EMPTY());
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_member_v = sprout::has_member<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_MEMBER_HPP

View file

@ -0,0 +1,28 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_MEMBER_POINTER_HPP
#define SPROUT_TYPE_TRAITS_HAS_MEMBER_POINTER_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
#include <sprout/preprocessor/empty.hpp>
namespace sprout {
//
// has_member_pointer
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(member_pointer, ->*, SPROUT_PP_EMPTY());
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_member_pointer_v = sprout::has_member_pointer<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_MEMBER_POINTER_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_MINUS_HPP
#define SPROUT_TYPE_TRAITS_HAS_MINUS_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_minus
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(minus, -, = T);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_minus_v = sprout::has_minus<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_MINUS_HPP

View file

@ -0,0 +1,28 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_MINUS_ASSIGN_HPP
#define SPROUT_TYPE_TRAITS_HAS_MINUS_ASSIGN_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/const_reference.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_minus_assign
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(minus_assign, -=, = typename sprout::const_reference<T>::type);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = typename sprout::const_reference<T>::type, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_minus_assign_v = sprout::has_minus_assign<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_MINUS_ASSIGN_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_MODULUS_HPP
#define SPROUT_TYPE_TRAITS_HAS_MODULUS_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_modulus
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(modulus, %, = T);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_modulus_v = sprout::has_modulus<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_MODULUS_HPP

View file

@ -0,0 +1,28 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_MODULUS_ASSIGN_HPP
#define SPROUT_TYPE_TRAITS_HAS_MODULUS_ASSIGN_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/const_reference.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_modulus_assign
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(modulus_assign, %=, = typename sprout::const_reference<T>::type);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = typename sprout::const_reference<T>::type, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_modulus_assign_v = sprout::has_modulus_assign<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_MODULUS_ASSIGN_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_MULTIPLIES_HPP
#define SPROUT_TYPE_TRAITS_HAS_MULTIPLIES_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_multiplies
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(multiplies, *, = T);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_multiplies_v = sprout::has_multiplies<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_MULTIPLIES_HPP

View file

@ -0,0 +1,28 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_MULTIPLIES_ASSIGN_HPP
#define SPROUT_TYPE_TRAITS_HAS_MULTIPLIES_ASSIGN_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/const_reference.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_multiplies_assign
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(multiplies_assign, *=, = typename sprout::const_reference<T>::type);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = typename sprout::const_reference<T>::type, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_multiplies_assign_v = sprout::has_multiplies_assign<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_MULTIPLIES_ASSIGN_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_NEGATE_HPP
#define SPROUT_TYPE_TRAITS_HAS_NEGATE_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_pre_unary_op.hpp>
namespace sprout {
//
// has_negate
//
SPROUT_DETAIL_HAS_PRE_UNARY_OP_DECL(negate, -);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_negate_v = sprout::has_negate<T, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_NEGATE_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_NOT_EQUAL_TO_HPP
#define SPROUT_TYPE_TRAITS_HAS_NOT_EQUAL_TO_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_not_equal_to
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(not_equal_to, !=, = T);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_not_equal_to_v = sprout::has_not_equal_to<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_NOT_EQUAL_TO_HPP

View file

@ -5,10 +5,68 @@
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_LOGICAL_HPP
#define SPROUT_TYPE_TRAITS_LOGICAL_HPP
#ifndef SPROUT_TYPE_TRAITS_HAS_OPERATOR_HPP
#define SPROUT_TYPE_TRAITS_HAS_OPERATOR_HPP
#include <sprout/config.hpp>
// arithmetic
#include <sprout/type_traits/has_plus.hpp>
#include <sprout/type_traits/has_minus.hpp>
#include <sprout/type_traits/has_multiplies.hpp>
#include <sprout/type_traits/has_divides.hpp>
#include <sprout/type_traits/has_modulus.hpp>
#include <sprout/type_traits/has_negate.hpp>
#include <sprout/type_traits/has_posite.hpp>
#include <sprout/type_traits/has_unary_minus.hpp>
#include <sprout/type_traits/has_unary_plus.hpp>
// comparison
#include <sprout/type_traits/has_equal_to.hpp>
#include <sprout/type_traits/has_not_equal_to.hpp>
#include <sprout/type_traits/has_greater.hpp>
#include <sprout/type_traits/has_less.hpp>
#include <sprout/type_traits/has_greater_equal.hpp>
#include <sprout/type_traits/has_less_equal.hpp>
// logical
#include <sprout/type_traits/has_logical_and.hpp>
#include <sprout/type_traits/has_logical_or.hpp>
#include <sprout/type_traits/has_logical_not.hpp>
// bitwise
#include <sprout/type_traits/has_bit_and.hpp>
#include <sprout/type_traits/has_bit_or.hpp>
#include <sprout/type_traits/has_bit_xor.hpp>
#include <sprout/type_traits/has_bit_not.hpp>
#include <sprout/type_traits/has_shift_left.hpp>
#include <sprout/type_traits/has_shift_right.hpp>
#include <sprout/type_traits/has_complement.hpp>
#include <sprout/type_traits/has_left_shift.hpp>
#include <sprout/type_traits/has_right_shift.hpp>
// inc_dec
#include <sprout/type_traits/has_pre_increment.hpp>
#include <sprout/type_traits/has_pre_decrement.hpp>
#include <sprout/type_traits/has_post_increment.hpp>
#include <sprout/type_traits/has_post_decrement.hpp>
// reference
#include <sprout/type_traits/has_address_of.hpp>
#include <sprout/type_traits/has_dereference.hpp>
// assignment
#include <sprout/type_traits/has_assign.hpp>
#include <sprout/type_traits/has_plus_assign.hpp>
#include <sprout/type_traits/has_minus_assign.hpp>
#include <sprout/type_traits/has_multiplies_assign.hpp>
#include <sprout/type_traits/has_divides_assign.hpp>
#include <sprout/type_traits/has_modulus_assign.hpp>
#include <sprout/type_traits/has_bit_and_assign.hpp>
#include <sprout/type_traits/has_bit_or_assign.hpp>
#include <sprout/type_traits/has_bit_xor_assign.hpp>
#include <sprout/type_traits/has_shift_left_assign.hpp>
#include <sprout/type_traits/has_shift_right_assign.hpp>
#include <sprout/type_traits/has_left_shift_assign.hpp>
#include <sprout/type_traits/has_right_shift_assign.hpp>
// members
#include <sprout/type_traits/has_member_pointer.hpp>
#include <sprout/type_traits/has_member.hpp>
// various
#include <sprout/type_traits/has_subscript.hpp>
#include <sprout/type_traits/has_comma.hpp>
#endif // #ifndef SPROUT_TYPE_TRAITS_LOGICAL_HPP
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_OPERATOR_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_PLUS_HPP
#define SPROUT_TYPE_TRAITS_HAS_PLUS_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_plus
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(plus, +, = T);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_plus_v = sprout::has_plus<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_PLUS_HPP

View file

@ -0,0 +1,28 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_PLUS_ASSIGN_HPP
#define SPROUT_TYPE_TRAITS_HAS_PLUS_ASSIGN_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/const_reference.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_plus_assign
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(plus_assign, +=, = typename sprout::const_reference<T>::type);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = typename sprout::const_reference<T>::type, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_plus_assign_v = sprout::has_plus_assign<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_PLUS_ASSIGN_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_POSITE_HPP
#define SPROUT_TYPE_TRAITS_HAS_POSITE_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_pre_unary_op.hpp>
namespace sprout {
//
// has_posite
//
SPROUT_DETAIL_HAS_PRE_UNARY_OP_DECL(posite, +);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_posite_v = sprout::has_posite<T, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_POSITE_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_POST_DECREMENT_HPP
#define SPROUT_TYPE_TRAITS_HAS_POST_DECREMENT_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_post_unary_op.hpp>
namespace sprout {
//
// has_post_decrement
//
SPROUT_DETAIL_HAS_PRE_UNARY_OP_DECL(post_decrement, --);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_post_decrement_v = sprout::has_post_decrement<T, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_POST_DECREMENT_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_POST_INCREMENT_HPP
#define SPROUT_TYPE_TRAITS_HAS_POST_INCREMENT_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_post_unary_op.hpp>
namespace sprout {
//
// has_post_increment
//
SPROUT_DETAIL_HAS_POST_UNARY_OP_DECL(post_increment, ++);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_post_increment_v = sprout::has_post_increment<T, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_POST_INCREMENT_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_PRE_DECREMENT_HPP
#define SPROUT_TYPE_TRAITS_HAS_PRE_DECREMENT_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_pre_unary_op.hpp>
namespace sprout {
//
// has_pre_decrement
//
SPROUT_DETAIL_HAS_PRE_UNARY_OP_DECL(pre_decrement, ++);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_pre_decrement_v = sprout::has_pre_decrement<T, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_PRE_DECREMENT_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_PRE_INCREMENT_HPP
#define SPROUT_TYPE_TRAITS_HAS_PRE_INCREMENT_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_pre_unary_op.hpp>
namespace sprout {
//
// has_pre_increment
//
SPROUT_DETAIL_HAS_PRE_UNARY_OP_DECL(pre_increment, --);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_pre_increment_v = sprout::has_pre_increment<T, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_PRE_INCREMENT_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_RIGHT_SHIFT_HPP
#define SPROUT_TYPE_TRAITS_HAS_RIGHT_SHIFT_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/has_shift_right.hpp>
namespace sprout {
//
// has_right_shift
//
template<typename T, typename U = T, typename R = sprout::dont_care>
struct has_right_shift
: public sprout::has_shift_right<T, U, R>
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_right_shift_v = sprout::has_right_shift<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_RIGHT_SHIFT_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_SHIFT_RIGHT_ASSIGN_HPP
#define SPROUT_TYPE_TRAITS_HAS_SHIFT_RIGHT_ASSIGN_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/has_shift_right_assign.hpp>
namespace sprout {
//
// has_right_shift_assign
//
template<typename T, typename U = typename sprout::const_reference<T>::type, typename R = sprout::dont_care>
struct has_right_shift_assign
: public sprout::has_shift_right<T, U, R>
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = typename sprout::const_reference<T>::type, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_right_shift_assign_v = sprout::has_right_shift_assign<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_SHIFT_RIGHT_ASSIGN_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_SHIFT_LEFT_HPP
#define SPROUT_TYPE_TRAITS_HAS_SHIFT_LEFT_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_shift_left
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(shift_left, <<, = T);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_shift_left_v = sprout::has_shift_left<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_SHIFT_LEFT_HPP

View file

@ -0,0 +1,28 @@
/*=============================================================================
Copyright (c) 2011-2016 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_SHIFT_LEFT_HAS_ASSIGN_HPP
#define SPROUT_TYPE_TRAITS_SHIFT_LEFT_HAS_ASSIGN_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/const_reference.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_shift_left_assign
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(shift_left_assign, <<=, = typename sprout::const_reference<T>::type);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = typename sprout::const_reference<T>::type, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_shift_left_assign_v = sprout::has_shift_left_assign<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_SHIFT_LEFT_HAS_ASSIGN_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_SHIFT_RIGHT_HPP
#define SPROUT_TYPE_TRAITS_HAS_SHIFT_RIGHT_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_shift_right
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(shift_right, >>, = T);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_shift_right_v = sprout::has_shift_right<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_SHIFT_RIGHT_HPP

View file

@ -0,0 +1,28 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_SHIFT_RIGHT_ASSIGN_HPP
#define SPROUT_TYPE_TRAITS_HAS_SHIFT_RIGHT_ASSIGN_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/const_reference.hpp>
#include <sprout/type_traits/detail/has_binary_op.hpp>
namespace sprout {
//
// has_shift_right_assign
//
SPROUT_DETAIL_HAS_BINARY_OP_DECL(shift_right_assign, >>=, = typename sprout::const_reference<T>::type);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = typename sprout::const_reference<T>::type, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_shift_right_assign_v = sprout::has_shift_right_assign<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_SHIFT_RIGHT_ASSIGN_HPP

View file

@ -0,0 +1,28 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_SUBSCRIPT_HPP
#define SPROUT_TYPE_TRAITS_HAS_SUBSCRIPT_HPP
#include <sprout/config.hpp>
#include <sprout/workaround/std/cstddef.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/detail/has_subscript_op.hpp>
namespace sprout {
//
// has_subscript
//
SPROUT_DETAIL_HAS_SUBSCRIPT_OP_DECL(subscript, [], = std::size_t);
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U = std::size_t, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_subscript_v = sprout::has_subscript<T, U, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_SUBSCRIPT_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_UNARY_MINUS_HPP
#define SPROUT_TYPE_TRAITS_HAS_UNARY_MINUS_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/has_negate.hpp>
namespace sprout {
//
// has_unary_minus
//
template<typename T, typename R = sprout::dont_care>
struct has_unary_minus
: public sprout::has_negate<T, R>
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_unary_minus_v = sprout::has_unary_minus<T, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_UNARY_MINUS_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2016 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_HAS_UNARY_PLUS_HPP
#define SPROUT_TYPE_TRAITS_HAS_UNARY_PLUS_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/dont_care.hpp>
#include <sprout/type_traits/has_posite.hpp>
namespace sprout {
//
// has_unary_plus
//
template<typename T, typename R = sprout::dont_care>
struct has_unary_plus
: public sprout::has_posite<T, R>
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename R = sprout::dont_care>
SPROUT_STATIC_CONSTEXPR bool has_unary_plus_v = sprout::has_unary_plus<T, R>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_UNARY_PLUS_HPP