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

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