mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2024-11-14 10:39:05 +00:00
[sprout.functional] add all transparent functors
This commit is contained in:
parent
2a57ee6af5
commit
be9a5f9b78
59 changed files with 1047 additions and 301 deletions
36
sprout/functional/address_of.hpp
Normal file
36
sprout/functional/address_of.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_ADDRESS_OF_HPP
|
||||
#define SPROUT_FUNCTIONAL_ADDRESS_OF_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// address_of
|
||||
//
|
||||
template<typename T = void>
|
||||
struct address_of;
|
||||
template<>
|
||||
struct address_of<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T>
|
||||
SPROUT_CONSTEXPR decltype(&std::declval<T>())
|
||||
operator()(T&& x)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(&std::declval<T>()))
|
||||
{
|
||||
return &sprout::forward<T>(x);
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_ADDRESS_OF_HPP
|
36
sprout/functional/assign.hpp
Normal file
36
sprout/functional/assign.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_ASSIGN_HPP
|
||||
#define SPROUT_FUNCTIONAL_ASSIGN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// assign
|
||||
//
|
||||
template<typename T = void>
|
||||
struct assign;
|
||||
template<>
|
||||
struct assign<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() = std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() = std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) = sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_ASSIGN_HPP
|
24
sprout/functional/assignment.hpp
Normal file
24
sprout/functional/assignment.hpp
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_ASSIGNMENT_HPP
|
||||
#define SPROUT_FUNCTIONAL_ASSIGNMENT_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/functional/assign.hpp>
|
||||
#include <sprout/functional/plus_assign.hpp>
|
||||
#include <sprout/functional/minus_assign.hpp>
|
||||
#include <sprout/functional/multiplies_assign.hpp>
|
||||
#include <sprout/functional/divides_assign.hpp>
|
||||
#include <sprout/functional/modulus_assign.hpp>
|
||||
#include <sprout/functional/bit_and_assign.hpp>
|
||||
#include <sprout/functional/bit_or_assign.hpp>
|
||||
#include <sprout/functional/bit_xor_assign.hpp>
|
||||
#include <sprout/functional/shift_left_assign.hpp>
|
||||
#include <sprout/functional/shift_right_assign.hpp>
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_ASSIGNMENT_HPP
|
36
sprout/functional/bit_and_assign.hpp
Normal file
36
sprout/functional/bit_and_assign.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_BIT_AND_ASSIGN_HPP
|
||||
#define SPROUT_FUNCTIONAL_BIT_AND_ASSIGN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// bit_and_assign
|
||||
//
|
||||
template<typename T = void>
|
||||
struct bit_and_assign;
|
||||
template<>
|
||||
struct bit_and_assign<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() &= std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() &= std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) &= sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_BIT_AND_ASSIGN_HPP
|
36
sprout/functional/bit_or_assign.hpp
Normal file
36
sprout/functional/bit_or_assign.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_BIT_OR_ASSIGN_HPP
|
||||
#define SPROUT_FUNCTIONAL_BIT_OR_ASSIGN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// bit_or_assign
|
||||
//
|
||||
template<typename T = void>
|
||||
struct bit_or_assign;
|
||||
template<>
|
||||
struct bit_or_assign<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() |= std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() |= std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) |= sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_BIT_OR_ASSIGN_HPP
|
36
sprout/functional/bit_xor_assign.hpp
Normal file
36
sprout/functional/bit_xor_assign.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_BIT_XOR_ASSIGN_HPP
|
||||
#define SPROUT_FUNCTIONAL_BIT_XOR_ASSIGN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// bit_xor_assign
|
||||
//
|
||||
template<typename T = void>
|
||||
struct bit_xor_assign;
|
||||
template<>
|
||||
struct bit_xor_assign<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() ^= std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() ^= std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) ^= sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_BIT_XOR_ASSIGN_HPP
|
|
@ -13,5 +13,7 @@
|
|||
#include <sprout/functional/bit_or.hpp>
|
||||
#include <sprout/functional/bit_xor.hpp>
|
||||
#include <sprout/functional/bit_not.hpp>
|
||||
#include <sprout/functional/shift_left.hpp>
|
||||
#include <sprout/functional/shift_right.hpp>
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_BITWISE_HPP
|
||||
|
|
36
sprout/functional/call_fun.hpp
Normal file
36
sprout/functional/call_fun.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_CALL_FUN_HPP
|
||||
#define SPROUT_FUNCTIONAL_CALL_FUN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// call_fun
|
||||
//
|
||||
template<typename T = void>
|
||||
struct call_fun;
|
||||
template<>
|
||||
struct call_fun<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename F, typename... As>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<F>()(std::declval<As>()...))
|
||||
operator()(F&& f, As&&... as)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<F>()(std::declval<As>()...)))
|
||||
{
|
||||
return sprout::forward<F>(f)(sprout::forward<As>(as)...);
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_CALL_FUN_HPP
|
36
sprout/functional/comma.hpp
Normal file
36
sprout/functional/comma.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_COMMA_HPP
|
||||
#define SPROUT_FUNCTIONAL_COMMA_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// comma
|
||||
//
|
||||
template<typename T = void>
|
||||
struct comma;
|
||||
template<>
|
||||
struct comma<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>(), std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR((std::declval<T>(), std::declval<U>())))
|
||||
{
|
||||
return sprout::forward<T>(x), sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_COMMA_HPP
|
36
sprout/functional/cond.hpp
Normal file
36
sprout/functional/cond.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_COND_HPP
|
||||
#define SPROUT_FUNCTIONAL_COND_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// cond
|
||||
//
|
||||
template<typename T = void>
|
||||
struct cond;
|
||||
template<>
|
||||
struct cond<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T, typename U, typename V>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() ? std::declval<U>() : std::declval<V>())
|
||||
operator()(T&& x, U&& y, V&& z)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() ? std::declval<U>() : std::declval<V>()))
|
||||
{
|
||||
return sprout::forward<T>(x) ? sprout::forward<U>(y) : sprout::forward<V>(z);
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_COND_HPP
|
36
sprout/functional/dereference.hpp
Normal file
36
sprout/functional/dereference.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_DEREFERENCE_HPP
|
||||
#define SPROUT_FUNCTIONAL_DEREFERENCE_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// dereference
|
||||
//
|
||||
template<typename T = void>
|
||||
struct dereference;
|
||||
template<>
|
||||
struct dereference<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T>
|
||||
SPROUT_CONSTEXPR decltype(*std::declval<T>())
|
||||
operator()(T&& x)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(*std::declval<T>()))
|
||||
{
|
||||
return *sprout::forward<T>(x);
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_DEREFERENCE_HPP
|
36
sprout/functional/divides_assign.hpp
Normal file
36
sprout/functional/divides_assign.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_DEVIDES_ASSIGN_HPP
|
||||
#define SPROUT_FUNCTIONAL_DEVIDES_ASSIGN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// divides_assign
|
||||
//
|
||||
template<typename T = void>
|
||||
struct divides_assign;
|
||||
template<>
|
||||
struct divides_assign<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() /= std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() /= std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) /= sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_DEVIDES_ASSIGN_HPP
|
|
@ -13,6 +13,11 @@
|
|||
#include <sprout/functional/comparison.hpp>
|
||||
#include <sprout/functional/logical.hpp>
|
||||
#include <sprout/functional/bitwise.hpp>
|
||||
#include <sprout/functional/inc_dec.hpp>
|
||||
#include <sprout/functional/reference.hpp>
|
||||
#include <sprout/functional/assignment.hpp>
|
||||
#include <sprout/functional/members.hpp>
|
||||
#include <sprout/functional/various.hpp>
|
||||
#include <sprout/functional/binder.hpp>
|
||||
#include <sprout/functional/negator.hpp>
|
||||
#include <sprout/functional/equiv.hpp>
|
||||
|
|
17
sprout/functional/inc_dec.hpp
Normal file
17
sprout/functional/inc_dec.hpp
Normal file
|
@ -0,0 +1,17 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_INC_DEC_HPP
|
||||
#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>
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_INC_DEC_HPP
|
36
sprout/functional/mem_ptr.hpp
Normal file
36
sprout/functional/mem_ptr.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_MEM_PTR_HPP
|
||||
#define SPROUT_FUNCTIONAL_MEM_PTR_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// mem_ptr
|
||||
//
|
||||
template<typename T = void>
|
||||
struct mem_ptr;
|
||||
template<>
|
||||
struct mem_ptr<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>()->*std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>()->*std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x)->*sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_MEM_PTR_HPP
|
36
sprout/functional/member.hpp
Normal file
36
sprout/functional/member.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_MEMBER_HPP
|
||||
#define SPROUT_FUNCTIONAL_MEMBER_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// member
|
||||
//
|
||||
template<typename T = void>
|
||||
struct member;
|
||||
template<>
|
||||
struct member<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>().*std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>().*std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x).*sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_MEMBER_HPP
|
15
sprout/functional/members.hpp
Normal file
15
sprout/functional/members.hpp
Normal file
|
@ -0,0 +1,15 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_MEMBERS_HPP
|
||||
#define SPROUT_FUNCTIONAL_MEMBERS_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/functional/mem_ptr.hpp>
|
||||
#include <sprout/functional/member.hpp>
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_MEMBERS_HPP
|
36
sprout/functional/minus_assign.hpp
Normal file
36
sprout/functional/minus_assign.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_MINUS_ASSIGN_HPP
|
||||
#define SPROUT_FUNCTIONAL_MINUS_ASSIGN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// minus_assign
|
||||
//
|
||||
template<typename T = void>
|
||||
struct minus_assign;
|
||||
template<>
|
||||
struct minus_assign<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() -= std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() -= std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) -= sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_MINUS_ASSIGN_HPP
|
36
sprout/functional/modulus_assign.hpp
Normal file
36
sprout/functional/modulus_assign.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_MODULUS_ASSIGN_HPP
|
||||
#define SPROUT_FUNCTIONAL_MODULUS_ASSIGN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// modulus_assign
|
||||
//
|
||||
template<typename T = void>
|
||||
struct modulus_assign;
|
||||
template<>
|
||||
struct modulus_assign<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() %= std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() %= std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) %= sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_MODULUS_ASSIGN_HPP
|
36
sprout/functional/multiplies_assign.hpp
Normal file
36
sprout/functional/multiplies_assign.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_MULTIPLIES_ASSIGN_HPP
|
||||
#define SPROUT_FUNCTIONAL_MULTIPLIES_ASSIGN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// multiplies_assign
|
||||
//
|
||||
template<typename T = void>
|
||||
struct multiplies_assign;
|
||||
template<>
|
||||
struct multiplies_assign<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() *= std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() *= std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) *= sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_MULTIPLIES_ASSIGN_HPP
|
36
sprout/functional/plus_assign.hpp
Normal file
36
sprout/functional/plus_assign.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_PLUS_ASSIGN_HPP
|
||||
#define SPROUT_FUNCTIONAL_PLUS_ASSIGN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// plus_assign
|
||||
//
|
||||
template<typename T = void>
|
||||
struct plus_assign;
|
||||
template<>
|
||||
struct plus_assign<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() += std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() += std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) += sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_PLUS_ASSIGN_HPP
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_ADDRESS_OF_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_ADDRESS_OF_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/address_of.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// address_of_t
|
||||
// address_of_
|
||||
//
|
||||
struct address_of_t {
|
||||
public:
|
||||
template<typename T>
|
||||
SPROUT_CONSTEXPR decltype(&std::declval<T>())
|
||||
operator()(T&& x)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(&std::declval<T>()))
|
||||
{
|
||||
return &sprout::forward<T>(x);
|
||||
}
|
||||
};
|
||||
typedef sprout::address_of<> address_of_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::address_of_t address_of_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_ASSIGN_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_ASSIGN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/assign.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// assign_t
|
||||
// assign_
|
||||
//
|
||||
struct assign_t {
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() = std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() = std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) = sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
typedef sprout::assign<> assign_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::assign_t assign_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_ASSIGNMENT_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/functional/polymorphic/assign.hpp>
|
||||
#include <sprout/functional/polymorphic/plus_assign.hpp>
|
||||
#include <sprout/functional/polymorphic/minus_assign.hpp>
|
||||
#include <sprout/functional/polymorphic/multiplies_assign.hpp>
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_BIT_AND_ASSIGN_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_BIT_AND_ASSIGN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/bit_and_assign.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// bit_and_assign_t
|
||||
// bit_and_assign_
|
||||
//
|
||||
struct bit_and_assign_t {
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() &= std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() &= std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) &= sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
typedef sprout::bit_and_assign<> bit_and_assign_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::bit_and_assign_t bit_and_assign_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_BIT_OR_ASSIGN_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_BIT_OR_ASSIGN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/bit_or_assign.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// bit_or_assign_t
|
||||
// bit_or_assign_
|
||||
//
|
||||
struct bit_or_assign_t {
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() |= std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() |= std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) |= sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
typedef sprout::bit_or_assign<> bit_or_assign_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::bit_or_assign_t bit_or_assign_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_BIT_XOR_ASSIGN_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_BIT_XOR_ASSIGN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/bit_xor_assign.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// bit_xor_assign_t
|
||||
// bit_xor_assign_
|
||||
//
|
||||
struct bit_xor_assign_t {
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() ^= std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() ^= std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) ^= sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
typedef sprout::bit_xor_assign<> bit_xor_assign_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::bit_xor_assign_t bit_xor_assign_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_CALL_FUN_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_CALL_FUN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/call_fun.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// call_fun_t
|
||||
// call_fun_
|
||||
//
|
||||
struct call_fun_t {
|
||||
public:
|
||||
template<typename F, typename... As>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<F>()(std::declval<As>()...))
|
||||
operator()(F&& f, As&&... as)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<F>()(std::declval<As>()...)))
|
||||
{
|
||||
return sprout::forward<F>(f)(sprout::forward<As>(as)...);
|
||||
}
|
||||
};
|
||||
typedef sprout::call_fun<> call_fun_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::call_fun_t call_fun_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_COMMA_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_COMMA_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/comma.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// comma_t
|
||||
// comma_
|
||||
//
|
||||
struct comma_t {
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>(), std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR((std::declval<T>(), std::declval<U>())))
|
||||
{
|
||||
return sprout::forward<T>(x), sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
typedef sprout::comma<> comma_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::comma_t comma_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_COND_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_COND_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/cond.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// cond_t
|
||||
// cond_
|
||||
//
|
||||
struct cond_t {
|
||||
public:
|
||||
template<typename T, typename U, typename V>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() ? std::declval<U>() : std::declval<V>())
|
||||
operator()(T&& x, U&& y, V&& z)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() ? std::declval<U>() : std::declval<V>()))
|
||||
{
|
||||
return sprout::forward<T>(x) ? sprout::forward<U>(y) : sprout::forward<V>(z);
|
||||
}
|
||||
};
|
||||
typedef sprout::cond<> cond_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::cond_t cond_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_DEREFERENCE_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_DEREFERENCE_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/dereference.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// dereference_t
|
||||
// dereference_
|
||||
//
|
||||
struct dereference_t {
|
||||
public:
|
||||
template<typename T>
|
||||
SPROUT_CONSTEXPR decltype(*std::declval<T>())
|
||||
operator()(T&& x)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(*std::declval<T>()))
|
||||
{
|
||||
return *sprout::forward<T>(x);
|
||||
}
|
||||
};
|
||||
typedef sprout::dereference<> dereference_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::dereference_t dereference_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_DEVIDES_ASSIGN_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_DEVIDES_ASSIGN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/divides_assign.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// divides_assign_t
|
||||
// divides_assign_
|
||||
//
|
||||
struct divides_assign_t {
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() /= std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() /= std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) /= sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
typedef sprout::divides_assign<> divides_assign_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::divides_assign_t divides_assign_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_MEM_PTR_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_MEM_PTR_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/mem_ptr.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// mem_ptr_t
|
||||
// mem_ptr_
|
||||
//
|
||||
struct mem_ptr_t {
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>()->*std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>()->*std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x)->*sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
typedef sprout::mem_ptr<> mem_ptr_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::mem_ptr_t mem_ptr_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_MEMBER_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_MEMBER_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/member.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// member_t
|
||||
// member_
|
||||
//
|
||||
struct member_t {
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>().*std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>().*std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x).*sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
typedef sprout::member<> member_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::member_t member_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_MINUS_ASSIGN_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_MINUS_ASSIGN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/minus_assign.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// minus_assign_t
|
||||
// minus_assign_
|
||||
//
|
||||
struct minus_assign_t {
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() -= std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() -= std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) -= sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
typedef sprout::minus_assign<> minus_assign_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::minus_assign_t minus_assign_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_MODULUS_ASSIGN_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_MODULUS_ASSIGN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/modulus_assign.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// modulus_assign_t
|
||||
// modulus_assign_
|
||||
//
|
||||
struct modulus_assign_t {
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() %= std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() %= std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) %= sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
typedef sprout::modulus_assign<> modulus_assign_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::modulus_assign_t modulus_assign_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_MULTIPLIES_ASSIGN_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_MULTIPLIES_ASSIGN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/multiplies_assign.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// multiplies_assign_t
|
||||
// multiplies_assign_
|
||||
//
|
||||
struct multiplies_assign_t {
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() *= std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() *= std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) *= sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
typedef sprout::multiplies_assign<> multiplies_assign_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::multiplies_assign_t multiplies_assign_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_PLUS_ASSIGN_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_PLUS_ASSIGN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/plus_assign.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// plus_assign_t
|
||||
// plus_assign_
|
||||
//
|
||||
struct plus_assign_t {
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() += std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() += std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) += sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
typedef sprout::plus_assign<> plus_assign_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::plus_assign_t plus_assign_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_POST_DEC_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_POST_DEC_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/post_dec.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// post_dec_t
|
||||
// post_dec_
|
||||
//
|
||||
struct post_dec_t {
|
||||
public:
|
||||
template<typename T>
|
||||
SPROUT_CONSTEXPR decltype(~std::declval<T>()--)
|
||||
operator()(T&& x)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(~std::declval<T>()--))
|
||||
{
|
||||
return sprout::forward<T>(x)--;
|
||||
}
|
||||
};
|
||||
typedef sprout::post_dec<> post_dec_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::post_dec_t post_dec_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_POST_INC_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_POST_INC_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/post_inc.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// post_inc_t
|
||||
// post_inc_
|
||||
//
|
||||
struct post_inc_t {
|
||||
public:
|
||||
template<typename T>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>()++)
|
||||
operator()(T&& x)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>()++))
|
||||
{
|
||||
return sprout::forward<T>(x)++;
|
||||
}
|
||||
};
|
||||
typedef sprout::post_inc<> post_inc_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::post_inc_t post_inc_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_PRE_DEC_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_PRE_DEC_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/pre_dec.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// pre_dec_t
|
||||
// pre_dec_
|
||||
//
|
||||
struct pre_dec_t {
|
||||
public:
|
||||
template<typename T>
|
||||
SPROUT_CONSTEXPR decltype(--std::declval<T>())
|
||||
operator()(T&& x)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(--std::declval<T>()))
|
||||
{
|
||||
return --sprout::forward<T>(x);
|
||||
}
|
||||
};
|
||||
typedef sprout::pre_dec<> pre_dec_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::pre_dec_t pre_dec_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_PRE_INC_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_PRE_INC_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/pre_inc.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// pre_inc_t
|
||||
// pre_inc_
|
||||
//
|
||||
struct pre_inc_t {
|
||||
public:
|
||||
template<typename T>
|
||||
SPROUT_CONSTEXPR decltype(++std::declval<T>())
|
||||
operator()(T&& x)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(++std::declval<T>()))
|
||||
{
|
||||
return ++sprout::forward<T>(x);
|
||||
}
|
||||
};
|
||||
typedef sprout::pre_inc<> pre_inc_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::pre_inc_t pre_inc_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_SHIFT_LEFT_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_SHIFT_LEFT_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/shift_left.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// shift_left_t
|
||||
// shift_left_
|
||||
//
|
||||
struct shift_left_t {
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() << std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() << std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) << sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
typedef sprout::shift_left<> shift_left_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::shift_left_t shift_left_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_SHIFT_LEFT_ASSIGN_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_SHIFT_LEFT_ASSIGN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/shift_left_assign.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// shift_left_assign_t
|
||||
// shift_left_assign_
|
||||
//
|
||||
struct shift_left_assign_t {
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() <<= std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() <<= std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) <<= sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
typedef sprout::shift_left_assign<> shift_left_assign_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::shift_left_assign_t shift_left_assign_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_SHIFT_LEFT_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_SHIFT_LEFT_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/shift_right.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// shift_right_t
|
||||
// shift_right_
|
||||
//
|
||||
struct shift_right_t {
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() >> std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() >> std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) >> sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
typedef sprout::shift_right<> shift_right_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::shift_right_t shift_right_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_SHIFT_LEFT_ASSIGN_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_SHIFT_LEFT_ASSIGN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/shift_right_assign.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// shift_right_assign_t
|
||||
// shift_right_assign_
|
||||
//
|
||||
struct shift_right_assign_t {
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() >>= std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() >>= std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) >>= sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
typedef sprout::shift_right_assign<> shift_right_assign_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::shift_right_assign_t shift_right_assign_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
|
@ -8,25 +8,15 @@
|
|||
#ifndef SPROUT_FUNCTIONAL_POLYMORPHIC_SUBSCRIPT_HPP
|
||||
#define SPROUT_FUNCTIONAL_POLYMORPHIC_SUBSCRIPT_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/functional/subscript.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// subscript_t
|
||||
// subscript_
|
||||
//
|
||||
struct subscript_t {
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>()[std::declval<U>()])
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>()[std::declval<U>()]))
|
||||
{
|
||||
return sprout::forward<T>(x)[sprout::forward<U>(y)];
|
||||
}
|
||||
};
|
||||
typedef sprout::subscript<> subscript_t;
|
||||
namespace {
|
||||
SPROUT_STATIC_CONSTEXPR sprout::subscript_t subscript_ = {};
|
||||
} // anonymous-namespace
|
||||
|
|
36
sprout/functional/post_dec.hpp
Normal file
36
sprout/functional/post_dec.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_POST_DEC_HPP
|
||||
#define SPROUT_FUNCTIONAL_POST_DEC_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// post_dec
|
||||
//
|
||||
template<typename T = void>
|
||||
struct post_dec;
|
||||
template<>
|
||||
struct post_dec<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T>
|
||||
SPROUT_CONSTEXPR decltype(~std::declval<T>()--)
|
||||
operator()(T&& x)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(~std::declval<T>()--))
|
||||
{
|
||||
return sprout::forward<T>(x)--;
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_POST_DEC_HPP
|
36
sprout/functional/post_inc.hpp
Normal file
36
sprout/functional/post_inc.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_POST_INC_HPP
|
||||
#define SPROUT_FUNCTIONAL_POST_INC_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// post_inc
|
||||
//
|
||||
template<typename T = void>
|
||||
struct post_inc;
|
||||
template<>
|
||||
struct post_inc<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>()++)
|
||||
operator()(T&& x)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>()++))
|
||||
{
|
||||
return sprout::forward<T>(x)++;
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_POST_INC_HPP
|
36
sprout/functional/pre_dec.hpp
Normal file
36
sprout/functional/pre_dec.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_PRE_DEC_HPP
|
||||
#define SPROUT_FUNCTIONAL_PRE_DEC_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// pre_dec
|
||||
//
|
||||
template<typename T = void>
|
||||
struct pre_dec;
|
||||
template<>
|
||||
struct pre_dec<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T>
|
||||
SPROUT_CONSTEXPR decltype(--std::declval<T>())
|
||||
operator()(T&& x)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(--std::declval<T>()))
|
||||
{
|
||||
return --sprout::forward<T>(x);
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_PRE_DEC_HPP
|
36
sprout/functional/pre_inc.hpp
Normal file
36
sprout/functional/pre_inc.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_PRE_INC_HPP
|
||||
#define SPROUT_FUNCTIONAL_PRE_INC_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// pre_inc
|
||||
//
|
||||
template<typename T = void>
|
||||
struct pre_inc;
|
||||
template<>
|
||||
struct pre_inc<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T>
|
||||
SPROUT_CONSTEXPR decltype(++std::declval<T>())
|
||||
operator()(T&& x)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(++std::declval<T>()))
|
||||
{
|
||||
return ++sprout::forward<T>(x);
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_PRE_INC_HPP
|
15
sprout/functional/reference.hpp
Normal file
15
sprout/functional/reference.hpp
Normal file
|
@ -0,0 +1,15 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_REFERENCE_HPP
|
||||
#define SPROUT_FUNCTIONAL_REFERENCE_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/functional/address_of.hpp>
|
||||
#include <sprout/functional/dereference.hpp>
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_REFERENCE_HPP
|
36
sprout/functional/shift_left.hpp
Normal file
36
sprout/functional/shift_left.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_SHIFT_LEFT_HPP
|
||||
#define SPROUT_FUNCTIONAL_SHIFT_LEFT_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// shift_left
|
||||
//
|
||||
template<typename T = void>
|
||||
struct shift_left;
|
||||
template<>
|
||||
struct shift_left<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() << std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() << std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) << sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_SHIFT_LEFT_HPP
|
36
sprout/functional/shift_left_assign.hpp
Normal file
36
sprout/functional/shift_left_assign.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_SHIFT_LEFT_ASSIGN_HPP
|
||||
#define SPROUT_FUNCTIONAL_SHIFT_LEFT_ASSIGN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// shift_left_assign
|
||||
//
|
||||
template<typename T = void>
|
||||
struct shift_left_assign;
|
||||
template<>
|
||||
struct shift_left_assign<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() <<= std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() <<= std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) <<= sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_SHIFT_LEFT_ASSIGN_HPP
|
36
sprout/functional/shift_right.hpp
Normal file
36
sprout/functional/shift_right.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_SHIFT_RIGHT_HPP
|
||||
#define SPROUT_FUNCTIONAL_SHIFT_RIGHT_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// shift_right
|
||||
//
|
||||
template<typename T = void>
|
||||
struct shift_right;
|
||||
template<>
|
||||
struct shift_right<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() >> std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() << std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) >> sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_SHIFT_RIGHT_HPP
|
36
sprout/functional/shift_right_assign.hpp
Normal file
36
sprout/functional/shift_right_assign.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_SHIFT_LEFT_ASSIGN_HPP
|
||||
#define SPROUT_FUNCTIONAL_SHIFT_LEFT_ASSIGN_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// shift_right_assign
|
||||
//
|
||||
template<typename T = void>
|
||||
struct shift_right_assign;
|
||||
template<>
|
||||
struct shift_right_assign<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>() >>= std::declval<U>())
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>() >>= std::declval<U>()))
|
||||
{
|
||||
return sprout::forward<T>(x) >>= sprout::forward<U>(y);
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_SHIFT_LEFT_ASSIGN_HPP
|
36
sprout/functional/subscript.hpp
Normal file
36
sprout/functional/subscript.hpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_SUBSCRIPT_HPP
|
||||
#define SPROUT_FUNCTIONAL_SUBSCRIPT_HPP
|
||||
|
||||
#include <utility>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// subscript
|
||||
//
|
||||
template<typename T = void>
|
||||
struct subscript;
|
||||
template<>
|
||||
struct subscript<void> {
|
||||
public:
|
||||
typedef void is_transparent;
|
||||
public:
|
||||
template<typename T, typename U>
|
||||
SPROUT_CONSTEXPR decltype(std::declval<T>()[std::declval<U>()])
|
||||
operator()(T&& x, U&& y)
|
||||
const SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::declval<T>()[std::declval<U>()]))
|
||||
{
|
||||
return sprout::forward<T>(x)[sprout::forward<U>(y)];
|
||||
}
|
||||
};
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_SUBSCRIPT_HPP
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
namespace sprout {
|
||||
//
|
||||
// is_transparent
|
||||
// is_transparent_function
|
||||
//
|
||||
SPROUT_HAS_XXX_TYPE_DEF(is_transparent_function, is_transparent);
|
||||
} // namespace sprout
|
||||
|
|
17
sprout/functional/various.hpp
Normal file
17
sprout/functional/various.hpp
Normal file
|
@ -0,0 +1,17 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2013 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_VARIOUS_HPP
|
||||
#define SPROUT_FUNCTIONAL_VARIOUS_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/functional/subscript.hpp>
|
||||
#include <sprout/functional/call_fun.hpp>
|
||||
#include <sprout/functional/cond.hpp>
|
||||
#include <sprout/functional/comma.hpp>
|
||||
|
||||
#endif // #ifndef SPROUT_FUNCTIONAL_VARIOUS_HPP
|
Loading…
Reference in a new issue