Stratosphere: Add WrapIpcCommandImpl templating.
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
@Copyright Barrett Adair 2016-2017
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BOOST_CLBL_TRTS_DETAIL_CONFIG_HPP
|
||||
#define BOOST_CLBL_TRTS_DETAIL_CONFIG_HPP
|
||||
|
||||
#include <type_traits>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
#include <cstdint>
|
||||
|
||||
#define BOOST_CLBL_TRTS_EMPTY_
|
||||
#define BOOST_CLBL_TRTS_EMPTY BOOST_CLBL_TRTS_EMPTY_
|
||||
|
||||
#ifdef __cpp_transactional_memory
|
||||
# define BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE
|
||||
#endif
|
||||
|
||||
#ifdef __cpp_inline_variables
|
||||
# define BOOST_CLBL_TRAITS_INLINE_VAR inline
|
||||
#else
|
||||
# define BOOST_CLBL_TRAITS_INLINE_VAR
|
||||
#endif
|
||||
|
||||
#ifdef __cpp_noexcept_function_type
|
||||
# define BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE
|
||||
# define BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER transaction_safe
|
||||
#else
|
||||
# define BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER
|
||||
#endif
|
||||
|
||||
#ifndef __clang__
|
||||
# if defined(__GNUC__)
|
||||
# define BOOST_CLBL_TRTS_GCC
|
||||
# if __GNUC__ >= 6
|
||||
# define BOOST_CLBL_TRTS_GCC_AT_LEAST_6_0_0
|
||||
# endif
|
||||
# if __GNUC__ < 5
|
||||
# define BOOST_CLBL_TRTS_GCC_OLDER_THAN_5_0_0
|
||||
# endif
|
||||
# if __GNUC__ >= 5
|
||||
# define BOOST_CLBL_TRTS_GCC_AT_LEAST_4_9_2
|
||||
# elif __GNUC__ == 4 && __GNUC_MINOR__ == 9 && __GNUC_PATCHLEVEL__ >= 2
|
||||
# define BOOST_CLBL_TRTS_GCC_AT_LEAST_4_9_2
|
||||
# else
|
||||
# define BOOST_CLBL_TRTS_GCC_OLDER_THAN_4_9_2
|
||||
# endif //#if __GNUC__ >= 5
|
||||
# endif //#if defined __GNUC__
|
||||
#endif // #ifndef __clang__
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# ifdef __clang__
|
||||
# define BOOST_CLBL_TRTS_CLANG_C2
|
||||
# else
|
||||
# define BOOST_CLBL_TRTS_MSVC
|
||||
# endif // #ifdef __clang__
|
||||
#endif // #ifdef _MSC_VER
|
||||
|
||||
#define BOOST_CLBL_TRTS_IX_SEQ(...) ::std::index_sequence< __VA_ARGS__ >
|
||||
#define BOOST_CLBL_TRTS_MAKE_IX_SEQ(...) ::std::make_index_sequence< __VA_ARGS__ >
|
||||
#define BOOST_CLBL_TRTS_DISJUNCTION(...) ::std::disjunction< __VA_ARGS__ >
|
||||
|
||||
#ifndef __cpp_variable_templates
|
||||
# define BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES
|
||||
#endif
|
||||
|
||||
#ifndef __cpp_lib_logical_traits
|
||||
# include <boost/callable_traits/detail/polyfills/disjunction.hpp>
|
||||
#endif //__cpp_lib_logical_traits
|
||||
|
||||
#ifndef __cpp_lib_integer_sequence
|
||||
# include <boost/callable_traits/detail/polyfills/make_index_sequence.hpp>
|
||||
#endif // __cpp_lib_integer_sequence
|
||||
|
||||
#if defined(BOOST_CLBL_TRTS_MSVC) && !defined(BOOST_DISABLE_WIN32)
|
||||
# define BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC __cdecl
|
||||
# define BOOST_CLBL_TRTS_PMF_VARGARGS_CDECL_DEFAULT
|
||||
#else
|
||||
# define BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC
|
||||
#endif // #if defined(BOOST_CLBL_TRTS_MSVC) && !defined(BOOST_DISABLE_WIN32))
|
||||
|
||||
#if (defined(BOOST_CLBL_TRTS_GCC) && !defined(BOOST_CLBL_TRTS_GCC_AT_LEAST_4_9_2)) || defined(__INTEL_COMPILER)
|
||||
# define BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS
|
||||
# define BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
|
||||
#endif // #if defined BOOST_CLBL_TRTS_GCC && !defined(BOOST_CLBL_TRTS_GCC_AT_LEAST_4_9_2)
|
||||
|
||||
#ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
|
||||
# define BOOST_CLBL_TRTS_ABOMINABLE_CONST BOOST_CLBL_TRTS_EMPTY
|
||||
# define BOOST_CLBL_TRTS_ABOMINABLE_VOLATILE BOOST_CLBL_TRTS_EMPTY
|
||||
#else
|
||||
# define BOOST_CLBL_TRTS_ABOMINABLE_CONST const
|
||||
# define BOOST_CLBL_TRTS_ABOMINABLE_VOLATILE volatile
|
||||
#endif // #ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
|
||||
|
||||
#ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
|
||||
# define BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER noexcept
|
||||
#else
|
||||
# define BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER BOOST_CLBL_TRTS_EMPTY
|
||||
#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
|
||||
|
||||
#endif // #ifndef BOOST_CLBL_TRTS_DETAIL_CONFIG_HPP
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
|
||||
@Copyright Barrett Adair 2016-2017
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BOOST_CLBL_TRTS_DETAIL_CORE_HPP
|
||||
#define BOOST_CLBL_TRTS_DETAIL_CORE_HPP
|
||||
|
||||
#include <boost/callable_traits/detail/utility.hpp>
|
||||
#include <boost/callable_traits/detail/traits.hpp>
|
||||
#include <boost/callable_traits/detail/function_object.hpp>
|
||||
#include <boost/callable_traits/detail/function.hpp>
|
||||
#include <boost/callable_traits/detail/pmf.hpp>
|
||||
#include <boost/callable_traits/detail/pmd.hpp>
|
||||
|
||||
#endif // #ifndef BOOST_CLBL_TRTS_DETAIL_CORE_HPP
|
||||
@@ -0,0 +1,207 @@
|
||||
/*
|
||||
Copyright Barrett Adair 2016-2017
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http ://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BOOST_CLBL_TRTS_DETAIL_DEFAULT_BOOST_CLBL_TRTS_HPP
|
||||
#define BOOST_CLBL_TRTS_DETAIL_DEFAULT_BOOST_CLBL_TRTS_HPP
|
||||
|
||||
namespace boost { namespace callable_traits { namespace detail {
|
||||
|
||||
template<typename T = void>
|
||||
struct default_callable_traits {
|
||||
|
||||
// value is used by all traits classes to participate
|
||||
// in the <callable_traits/detail/traits.hpp> disjunction.
|
||||
static constexpr bool value = false;
|
||||
|
||||
// used facilitate the disjunction in
|
||||
// <callable_traits/detail/traits.hpp>
|
||||
using traits = default_callable_traits;
|
||||
|
||||
using error_t = error_type<T>;
|
||||
|
||||
// represents the type under consideration
|
||||
using type = error_t;
|
||||
|
||||
// std::true_type for callables with C-style variadics
|
||||
using has_varargs = std::false_type;
|
||||
|
||||
using return_type = error_t;
|
||||
|
||||
// arg_types is a std::tuple of argument types for
|
||||
// callables that are not overloaded/templated function objects.
|
||||
// arg_types IS defined in terms of INVOKE, which means
|
||||
// a PMF's arg_types tuple will use a reference to its
|
||||
// parent class as the first argument, with qualifiers added to
|
||||
// match the PMF's own qualifiers.
|
||||
using arg_types = error_t;
|
||||
|
||||
// arg_types without the decltype(*this) parameter for member functions
|
||||
using non_invoke_arg_types = error_t;
|
||||
|
||||
// An "approximation" of a callable type, in the form
|
||||
// of a plain function type. Defined in terms of INVOKE.
|
||||
// An identity alias for qualified/unqualified plain function
|
||||
// types.
|
||||
using function_type = error_t;
|
||||
|
||||
// Used to smoothen the edges between PMFs and function objects
|
||||
using function_object_signature = error_t;
|
||||
|
||||
// An identity alias for qualified/unqualified plain function
|
||||
// types. Equivalent to remove_member_pointer for PMFs. Same
|
||||
// as function_type for other callable types.
|
||||
using qualified_function_type = error_t;
|
||||
|
||||
// Removes C-style variadics from a signature, if present.
|
||||
// Aliases error_t for function objects and PMDs.
|
||||
using remove_varargs = error_t;
|
||||
|
||||
// Adds C-style variadics to a signature. Aliases
|
||||
// error_t for function objects and PMDs.
|
||||
using add_varargs = error_t;
|
||||
|
||||
// std::true_type when the signature includes noexcept, when
|
||||
// the feature is available
|
||||
using is_noexcept = std::false_type;
|
||||
|
||||
// adds noexcept to a signature if the feature is available
|
||||
using add_noexcept = error_t;
|
||||
|
||||
// removes noexcept from a signature if present
|
||||
using remove_noexcept = error_t;
|
||||
|
||||
// std::true_type when the signature includes transaction_safe, when
|
||||
// the feature is available
|
||||
using is_transaction_safe = std::false_type;
|
||||
|
||||
// adds transaction_safe to a signature if the feature is available
|
||||
using add_transaction_safe = error_t;
|
||||
|
||||
// removes transaction_safe from a signature if present
|
||||
using remove_transaction_safe = error_t;
|
||||
|
||||
// The class of a PMD or PMF. error_t for other types
|
||||
using class_type = error_t;
|
||||
|
||||
// The qualified reference type of class_type. error_t
|
||||
// for non-member-pointers.
|
||||
using invoke_type = error_t;
|
||||
|
||||
// Removes reference qualifiers from a signature.
|
||||
using remove_reference = error_t;
|
||||
|
||||
// Adds an lvalue qualifier to a signature, in arbitrary
|
||||
// accordance with C++11 reference collapsing rules.
|
||||
using add_member_lvalue_reference = error_t;
|
||||
|
||||
// Adds an rvalue qualifier to a signature, in arbitrary
|
||||
// accordance with C++11 reference collapsing rules.
|
||||
using add_member_rvalue_reference = error_t;
|
||||
|
||||
// Adds a const qualifier to a signature.
|
||||
using add_member_const = error_t;
|
||||
|
||||
// Adds a volatile qualifier to a signature.
|
||||
using add_member_volatile = error_t;
|
||||
|
||||
// Adds both const and volatile qualifiers to a signature.
|
||||
using add_member_cv = error_t;
|
||||
|
||||
// Removes a const qualifier from a signature, if present.
|
||||
using remove_member_const = error_t;
|
||||
|
||||
// Removes a volatile qualifier from a signature, if present.
|
||||
using remove_member_volatile = error_t;
|
||||
|
||||
// Removes both const and volatile qualifiers from a
|
||||
// signature, if any.
|
||||
using remove_member_cv = error_t;
|
||||
|
||||
// Removes the member pointer from PMDs and PMFs. An identity
|
||||
// alias for other callable types.
|
||||
using remove_member_pointer = error_t;
|
||||
|
||||
// Changes the parent class type for PMDs and PMFs. Turns
|
||||
// function pointers, function references, and
|
||||
// qualified/unqualified function types into PMFs. Turns
|
||||
// everything else into member data pointers.
|
||||
template<typename C,
|
||||
typename U = T,
|
||||
typename K = typename std::remove_reference<U>::type,
|
||||
typename L = typename std::conditional<
|
||||
std::is_same<void, K>::value, error_t, K>::type,
|
||||
typename Class = typename std::conditional<
|
||||
std::is_class<C>::value, C, error_t>::type>
|
||||
using apply_member_pointer = typename std::conditional<
|
||||
std::is_same<L, error_t>::value || std::is_same<Class, error_t>::value,
|
||||
error_t, L Class::*>::type;
|
||||
|
||||
// Changes the return type of PMFs, function pointers, function
|
||||
// references, and qualified/unqualified function types. Changes
|
||||
// the data type of PMDs. error_t for function objects.
|
||||
template<typename>
|
||||
using apply_return = error_t;
|
||||
|
||||
// Expands the argument types into a template
|
||||
template<template<class...> class Container>
|
||||
using expand_args = error_t;
|
||||
|
||||
template<template<class...> class Container, typename... RightArgs>
|
||||
using expand_args_left = error_t;
|
||||
|
||||
template<template<class...> class Container, typename... LeftArgs>
|
||||
using expand_args_right = error_t;
|
||||
|
||||
using clear_args = error_t;
|
||||
|
||||
template<typename... NewArgs>
|
||||
using push_front = error_t;
|
||||
|
||||
template<typename... NewArgs>
|
||||
using push_back = error_t;
|
||||
|
||||
template<std::size_t ElementCount>
|
||||
using pop_front = error_t;
|
||||
|
||||
template<std::size_t ElementCount>
|
||||
using pop_back = error_t;
|
||||
|
||||
template<std::size_t Index, typename... NewArgs>
|
||||
using insert_args = error_t;
|
||||
|
||||
template<std::size_t Index, std::size_t Count>
|
||||
using remove_args = error_t;
|
||||
|
||||
template<std::size_t Index, typename... NewArgs>
|
||||
using replace_args = error_t;
|
||||
|
||||
static constexpr qualifier_flags cv_flags = cv_of<T>::value;
|
||||
static constexpr qualifier_flags ref_flags = ref_of<T>::value;
|
||||
static constexpr qualifier_flags q_flags = cv_flags | ref_flags;
|
||||
|
||||
using has_member_qualifiers = std::integral_constant<bool, q_flags != default_>;
|
||||
using is_const_member = std::integral_constant<bool, 0 < (cv_flags & const_)>;
|
||||
using is_volatile_member = std::integral_constant<bool, 0 < (cv_flags & volatile_)>;
|
||||
using is_cv_member = std::integral_constant<bool, cv_flags == (const_ | volatile_)>;
|
||||
|
||||
#ifdef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS
|
||||
using is_reference_member = std::false_type;
|
||||
using is_lvalue_reference_member = std::false_type;
|
||||
using is_rvalue_reference_member = std::false_type;
|
||||
#else
|
||||
using is_reference_member = std::integral_constant<bool, 0 < ref_flags>;
|
||||
using is_lvalue_reference_member = std::integral_constant<bool, ref_flags == lref_>;
|
||||
using is_rvalue_reference_member = std::integral_constant<bool, ref_flags == rref_>;
|
||||
#endif //#ifdef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS
|
||||
|
||||
};
|
||||
|
||||
}}} // namespace boost::callable_traits::detail
|
||||
|
||||
#endif // BOOST_CLBL_TRTS_DETAIL_DEFAULT_BOOST_CLBL_TRTS_HPP
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
#ifndef BOOST_CLBL_TRTS_DETAIL_FORWARD_DECLARATIONS
|
||||
#define BOOST_CLBL_TRTS_DETAIL_FORWARD_DECLARATIONS
|
||||
#include <boost/callable_traits/detail/config.hpp>
|
||||
#include <boost/callable_traits/detail/default_callable_traits.hpp>
|
||||
|
||||
namespace boost { namespace callable_traits { namespace detail {
|
||||
|
||||
template<typename T>
|
||||
struct function;
|
||||
|
||||
template<typename T>
|
||||
struct has_normal_call_operator
|
||||
{
|
||||
template<typename N, N Value>
|
||||
struct check { check(std::nullptr_t) {} };
|
||||
|
||||
template<typename U>
|
||||
static std::int8_t test(
|
||||
check<decltype(&U::operator()), &U::operator()>);
|
||||
|
||||
template<typename>
|
||||
static std::int16_t test(...);
|
||||
|
||||
static constexpr bool value =
|
||||
sizeof(test<T>(nullptr)) == sizeof(std::int8_t);
|
||||
};
|
||||
|
||||
struct callable_dummy {
|
||||
void operator()() {}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
using default_to_function_object = typename std::conditional<
|
||||
has_normal_call_operator<T>::value,
|
||||
T, callable_dummy>::type;
|
||||
|
||||
template<typename T>
|
||||
struct pmf;
|
||||
|
||||
template<typename T>
|
||||
struct pmd;
|
||||
|
||||
template<typename F, typename T = typename std::remove_reference<F>::type>
|
||||
using function_object_base = typename std::conditional<
|
||||
has_normal_call_operator<T>::value,
|
||||
pmf<decltype(&default_to_function_object<T>::operator())>,
|
||||
default_callable_traits<T>>::type;
|
||||
|
||||
template<typename T, typename Base = function_object_base<T>>
|
||||
struct function_object;
|
||||
|
||||
}}} // namespace boost::callable_traits::detail
|
||||
|
||||
#endif // #ifndef BOOST_CLBL_TRTS_DETAIL_FORWARD_DECLARATIONS
|
||||
@@ -0,0 +1,192 @@
|
||||
/*
|
||||
|
||||
@Copyright Barrett Adair 2015-2017
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BOOST_CLBL_TRTS_DETAIL_FUNCTION_HPP
|
||||
#define BOOST_CLBL_TRTS_DETAIL_FUNCTION_HPP
|
||||
|
||||
#include <boost/callable_traits/detail/config.hpp>
|
||||
#include <boost/callable_traits/detail/qualifier_flags.hpp>
|
||||
#include <boost/callable_traits/detail/forward_declarations.hpp>
|
||||
#include <boost/callable_traits/detail/set_function_qualifiers.hpp>
|
||||
#include <boost/callable_traits/detail/default_callable_traits.hpp>
|
||||
|
||||
namespace boost { namespace callable_traits { namespace detail {
|
||||
|
||||
template<typename T>
|
||||
struct function : default_callable_traits<T> {};
|
||||
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#include <boost/callable_traits/detail/unguarded/function.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
|
||||
#ifndef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS const
|
||||
#include <boost/callable_traits/detail/unguarded/function.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS volatile
|
||||
#include <boost/callable_traits/detail/unguarded/function.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS const volatile
|
||||
#include <boost/callable_traits/detail/unguarded/function.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
|
||||
#ifndef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS &
|
||||
#include <boost/callable_traits/detail/unguarded/function.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS &&
|
||||
#include <boost/callable_traits/detail/unguarded/function.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS const &
|
||||
#include <boost/callable_traits/detail/unguarded/function.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS const &&
|
||||
#include <boost/callable_traits/detail/unguarded/function.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS volatile &
|
||||
#include <boost/callable_traits/detail/unguarded/function.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS volatile &&
|
||||
#include <boost/callable_traits/detail/unguarded/function.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS const volatile &
|
||||
#include <boost/callable_traits/detail/unguarded/function.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS const volatile &&
|
||||
#include <boost/callable_traits/detail/unguarded/function.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
|
||||
#endif // #ifndef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS
|
||||
#endif // #ifndef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
|
||||
|
||||
// function pointers
|
||||
|
||||
#define BOOST_CLBL_TRTS_CC_TAG dummy
|
||||
#define BOOST_CLBL_TRTS_VARARGS_CC BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC
|
||||
#define BOOST_CLBL_TRTS_CC
|
||||
#define BOOST_CLBL_TRTS_ST
|
||||
#include <boost/callable_traits/detail/unguarded/function_ptr.hpp>
|
||||
#include <boost/callable_traits/detail/unguarded/function_ptr_varargs.hpp>
|
||||
#undef BOOST_CLBL_TRTS_ST
|
||||
#undef BOOST_CLBL_TRTS_CC
|
||||
#undef BOOST_CLBL_TRTS_CC_TAG
|
||||
#undef BOOST_CLBL_TRTS_VARARGS_CC
|
||||
|
||||
/* ?
|
||||
#ifdef BOOST_CLBL_TRTS_ENABLE_CDECL
|
||||
#define BOOST_CLBL_TRTS_CC_TAG cdecl_tag
|
||||
#define BOOST_CLBL_TRTS_VARARGS_CC __cdecl
|
||||
#define BOOST_CLBL_TRTS_CC __cdecl
|
||||
#define BOOST_CLBL_TRTS_ST
|
||||
#include <boost/callable_traits/detail/unguarded/function_ptr.hpp>
|
||||
#undef BOOST_CLBL_TRTS_ST
|
||||
#undef BOOST_CLBL_TRTS_CC
|
||||
#undef BOOST_CLBL_TRTS_CC_TAG
|
||||
#undef BOOST_CLBL_TRTS_VARARGS_CC
|
||||
#endif*/
|
||||
|
||||
#ifdef BOOST_CLBL_TRTS_ENABLE_STDCALL
|
||||
#define BOOST_CLBL_TRTS_CC_TAG stdcall_tag
|
||||
#define BOOST_CLBL_TRTS_VARARGS_CC BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC
|
||||
#define BOOST_CLBL_TRTS_CC __stdcall
|
||||
#define BOOST_CLBL_TRTS_ST
|
||||
#include <boost/callable_traits/detail/unguarded/function_ptr.hpp>
|
||||
#undef BOOST_CLBL_TRTS_ST
|
||||
#undef BOOST_CLBL_TRTS_CC
|
||||
#undef BOOST_CLBL_TRTS_CC_TAG
|
||||
#undef BOOST_CLBL_TRTS_VARARGS_CC
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_CLBL_TRTS_ENABLE_FASTCALL
|
||||
#define BOOST_CLBL_TRTS_CC_TAG fastcall_tag
|
||||
#define BOOST_CLBL_TRTS_VARARGS_CC BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC
|
||||
#define BOOST_CLBL_TRTS_CC __fastcall
|
||||
#define BOOST_CLBL_TRTS_ST
|
||||
#include <boost/callable_traits/detail/unguarded/function_ptr.hpp>
|
||||
#undef BOOST_CLBL_TRTS_CC
|
||||
#undef BOOST_CLBL_TRTS_ST
|
||||
#undef BOOST_CLBL_TRTS_CC_TAG
|
||||
#undef BOOST_CLBL_TRTS_VARARGS_CC
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_CLBL_TRTS_ENABLE_PASCAL
|
||||
#define BOOST_CLBL_TRTS_CC_TAG pascal_tag
|
||||
#define BOOST_CLBL_TRTS_VARARGS_CC BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC
|
||||
#define BOOST_CLBL_TRTS_CC
|
||||
#define BOOST_CLBL_TRTS_ST pascal
|
||||
#include <boost/callable_traits/detail/unguarded/function_ptr.hpp>
|
||||
#undef BOOST_CLBL_TRTS_CC
|
||||
#undef BOOST_CLBL_TRTS_ST
|
||||
#undef BOOST_CLBL_TRTS_CC_TAG
|
||||
#undef BOOST_CLBL_TRTS_VARARGS_CC
|
||||
#endif
|
||||
|
||||
template<typename T>
|
||||
struct function<T&> : std::conditional<function<T>::value,
|
||||
function<T>, default_callable_traits<T&>>::type {
|
||||
|
||||
static constexpr const bool value = !std::is_pointer<T>::value;
|
||||
|
||||
using traits = function;
|
||||
using base = function<T>;
|
||||
using type = T&;
|
||||
using remove_varargs = typename base::remove_varargs&;
|
||||
using add_varargs = typename base::add_varargs&;
|
||||
|
||||
using remove_member_reference = reference_error;
|
||||
using add_member_lvalue_reference = reference_error;
|
||||
using add_member_rvalue_reference = reference_error;
|
||||
using add_member_const = reference_error;
|
||||
using add_member_volatile = reference_error;
|
||||
using add_member_cv = reference_error;
|
||||
using remove_member_const = reference_error;
|
||||
using remove_member_volatile = reference_error;
|
||||
using remove_member_cv = reference_error;
|
||||
|
||||
template<typename NewReturn>
|
||||
using apply_return = typename base::template apply_return<NewReturn>&;
|
||||
|
||||
using clear_args = typename base::clear_args&;
|
||||
|
||||
template<typename... NewArgs>
|
||||
using push_front = typename base::template push_front<NewArgs...>&;
|
||||
|
||||
template<typename... NewArgs>
|
||||
using push_back = typename base::template push_back<NewArgs...>&;
|
||||
|
||||
template<std::size_t Count>
|
||||
using pop_back = typename base::template pop_back<Count>&;
|
||||
|
||||
template<std::size_t Count>
|
||||
using pop_front = typename base::template pop_front<Count>&;
|
||||
|
||||
template<std::size_t Index, typename... NewArgs>
|
||||
using insert_args = typename base::template insert_args<Index, NewArgs...>&;
|
||||
|
||||
template<std::size_t Index, std::size_t Count>
|
||||
using remove_args = typename base::template remove_args<Index, Count>&;
|
||||
|
||||
template<std::size_t Index, typename... NewArgs>
|
||||
using replace_args = typename base::template replace_args<Index, NewArgs...>&;
|
||||
};
|
||||
|
||||
}}} // namespace boost::callable_traits::detail
|
||||
|
||||
#endif // #ifndef BOOST_CLBL_TRTS_DETAIL_FUNCTION_HPP
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
|
||||
@Copyright Barrett Adair 2015-2017
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BOOST_CLBL_TRTS_DETAIL_FUNCTION_OBJECT_HPP
|
||||
#define BOOST_CLBL_TRTS_DETAIL_FUNCTION_OBJECT_HPP
|
||||
|
||||
#include <boost/callable_traits/detail/pmf.hpp>
|
||||
#include <boost/callable_traits/detail/default_callable_traits.hpp>
|
||||
#include <boost/callable_traits/detail/forward_declarations.hpp>
|
||||
#include <boost/callable_traits/detail/utility.hpp>
|
||||
|
||||
namespace boost { namespace callable_traits { namespace detail {
|
||||
|
||||
template<typename T, typename Base>
|
||||
struct function_object : Base {
|
||||
|
||||
using type = T;
|
||||
using error_t = error_type<T>;
|
||||
using function_type = typename Base::function_object_signature;
|
||||
using arg_types = typename Base::non_invoke_arg_types;
|
||||
using non_invoke_arg_types = arg_types;
|
||||
|
||||
static constexpr const bool value = std::is_class<
|
||||
typename std::remove_reference<T>::type>::value;
|
||||
|
||||
using traits = function_object;
|
||||
using class_type = error_t;
|
||||
using invoke_type = error_t;
|
||||
using remove_varargs = error_t;
|
||||
using add_varargs = error_t;
|
||||
using is_noexcept = typename Base::is_noexcept;
|
||||
using add_noexcept = error_t;
|
||||
using remove_noexcept = error_t;
|
||||
using is_transaction_safe = typename Base::is_transaction_safe;
|
||||
using add_transaction_safe = error_t;
|
||||
using remove_transaction_safe = error_t;
|
||||
using clear_args = error_t;
|
||||
|
||||
template<template<class...> class Container>
|
||||
using expand_args = typename function<function_type>::template
|
||||
expand_args<Container>;
|
||||
|
||||
template<template<class...> class Container, typename... RightArgs>
|
||||
using expand_args_left = typename function<function_type>::template
|
||||
expand_args_left<Container, RightArgs...>;
|
||||
|
||||
template<template<class...> class Container, typename... LeftArgs>
|
||||
using expand_args_right = typename function<function_type>::template
|
||||
expand_args_right<Container, LeftArgs...>;
|
||||
|
||||
template<typename C, typename U = T>
|
||||
using apply_member_pointer =
|
||||
typename std::remove_reference<U>::type C::*;
|
||||
|
||||
template<typename>
|
||||
using apply_return = error_t;
|
||||
|
||||
template<typename...>
|
||||
using push_front = error_t;
|
||||
|
||||
template<typename...>
|
||||
using push_back = error_t;
|
||||
|
||||
template<std::size_t ElementCount>
|
||||
using pop_args_front = error_t;
|
||||
|
||||
template<std::size_t ElementCount>
|
||||
using pop_args_back = error_t;
|
||||
|
||||
template<std::size_t Index, typename... NewArgs>
|
||||
using insert_args = error_t;
|
||||
|
||||
template<std::size_t Index, std::size_t Count>
|
||||
using remove_args = error_t;
|
||||
|
||||
template<std::size_t Index, typename... NewArgs>
|
||||
using replace_args = error_t;
|
||||
|
||||
template<std::size_t Count>
|
||||
using pop_front = error_t;
|
||||
|
||||
template<std::size_t Count>
|
||||
using pop_back = error_t;
|
||||
|
||||
using remove_member_reference = error_t;
|
||||
using add_member_lvalue_reference = error_t;
|
||||
using add_member_rvalue_reference = error_t;
|
||||
using add_member_const = error_t;
|
||||
using add_member_volatile = error_t;
|
||||
using add_member_cv = error_t;
|
||||
using remove_member_const = error_t;
|
||||
using remove_member_volatile = error_t;
|
||||
using remove_member_cv = error_t;
|
||||
};
|
||||
|
||||
template<typename T, typename U, typename Base>
|
||||
struct function_object <T U::*, Base>
|
||||
: default_callable_traits<> {};
|
||||
|
||||
}}} // namespace boost::callable_traits::detail
|
||||
|
||||
#endif // #ifndef BOOST_CLBL_TRTS_DETAIL_FUNCTION_OBJECT_HPP
|
||||
@@ -0,0 +1,148 @@
|
||||
/*!
|
||||
@file
|
||||
|
||||
@Copyright Barrett Adair 2015-2017
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BOOST_CLBL_TRTS_IS_INVOCABLE_IMPL_HPP
|
||||
#define BOOST_CLBL_TRTS_IS_INVOCABLE_IMPL_HPP
|
||||
|
||||
#include <boost/callable_traits/detail/config.hpp>
|
||||
#include <boost/callable_traits/detail/forward_declarations.hpp>
|
||||
#include <boost/callable_traits/detail/utility.hpp>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
namespace boost { namespace callable_traits { namespace detail {
|
||||
|
||||
template<typename T>
|
||||
struct can_dereference_t
|
||||
{
|
||||
template<typename>
|
||||
struct check {};
|
||||
|
||||
template<typename U>
|
||||
static std::int8_t test(
|
||||
check<typename std::remove_reference<decltype(*std::declval<U>())>::type>*
|
||||
);
|
||||
|
||||
template<typename>
|
||||
static std::int16_t test(...);
|
||||
|
||||
static constexpr const bool value =
|
||||
sizeof(test<T>(nullptr)) == sizeof(std::int8_t);
|
||||
};
|
||||
|
||||
//returns std::true_type for pointers and smart pointers
|
||||
template<typename T>
|
||||
using can_dereference = std::integral_constant<bool,
|
||||
can_dereference_t<T>::value>;
|
||||
|
||||
|
||||
template<typename T, typename = std::true_type>
|
||||
struct generalize_t {
|
||||
using type = T;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct generalize_t<T, std::integral_constant<bool,
|
||||
can_dereference<T>::value && !is_reference_wrapper<T>::value
|
||||
>>{
|
||||
using type = decltype(*std::declval<T>());
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct generalize_t<T, is_reference_wrapper<T>> {
|
||||
using type = decltype(std::declval<T>().get());
|
||||
};
|
||||
|
||||
// When T is a pointer, generalize<T> is the resulting type of the
|
||||
// pointer dereferenced. When T is an std::reference_wrapper, generalize<T>
|
||||
// is the underlying reference type. Otherwise, generalize<T> is T.
|
||||
template<typename T>
|
||||
using generalize = typename generalize_t<T>::type;
|
||||
|
||||
// handles the member pointer rules of INVOKE
|
||||
template<typename Base, typename T,
|
||||
typename IsBaseOf = std::is_base_of<Base, shallow_decay<T>>,
|
||||
typename IsSame = std::is_same<Base, shallow_decay<T>>>
|
||||
using generalize_if_dissimilar = typename std::conditional<
|
||||
IsBaseOf::value || IsSame::value, T, generalize<T>>::type;
|
||||
|
||||
template<typename Traits, bool = Traits::is_const_member::value
|
||||
|| Traits::is_volatile_member::value
|
||||
|| Traits::is_lvalue_reference_member::value
|
||||
|| Traits::is_rvalue_reference_member::value>
|
||||
struct test_invoke {
|
||||
|
||||
template<typename... Rgs,
|
||||
typename U = typename Traits::type>
|
||||
auto operator()(Rgs&&... rgs) const ->
|
||||
success<decltype(std::declval<U>()(static_cast<Rgs&&>(rgs)...))>;
|
||||
|
||||
auto operator()(...) const -> substitution_failure;
|
||||
};
|
||||
|
||||
template<typename F>
|
||||
struct test_invoke<function<F>, true /*abominable*/> {
|
||||
auto operator()(...) const -> substitution_failure;
|
||||
};
|
||||
|
||||
template<typename Pmf, bool Ignored>
|
||||
struct test_invoke<pmf<Pmf>, Ignored> {
|
||||
|
||||
using class_t = typename pmf<Pmf>::class_type;
|
||||
|
||||
template<typename U, typename... Rgs,
|
||||
typename Obj = generalize_if_dissimilar<class_t, U&&>>
|
||||
auto operator()(U&& u, Rgs&&... rgs) const ->
|
||||
success<decltype((std::declval<Obj>().*std::declval<Pmf>())(static_cast<Rgs&&>(rgs)...))>;
|
||||
|
||||
auto operator()(...) const -> substitution_failure;
|
||||
};
|
||||
|
||||
template<typename Pmd, bool Ignored>
|
||||
struct test_invoke<pmd<Pmd>, Ignored> {
|
||||
|
||||
using class_t = typename pmd<Pmd>::class_type;
|
||||
|
||||
template<typename U,
|
||||
typename Obj = generalize_if_dissimilar<class_t, U&&>>
|
||||
auto operator()(U&& u) const ->
|
||||
success<decltype(std::declval<Obj>().*std::declval<Pmd>())>;
|
||||
|
||||
auto operator()(...) const -> substitution_failure;
|
||||
};
|
||||
|
||||
template<typename T, typename... Args>
|
||||
struct is_invocable_impl {
|
||||
using traits = detail::traits<T>;
|
||||
using test = detail::test_invoke<traits>;
|
||||
using result = decltype(test{}(::std::declval<Args>()...));
|
||||
using type = std::integral_constant<bool, result::value>;
|
||||
};
|
||||
|
||||
template<typename... Args>
|
||||
struct is_invocable_impl<void, Args...> {
|
||||
using type = std::false_type;
|
||||
};
|
||||
|
||||
template<typename IsInvocable, typename Ret, typename T, typename... Args>
|
||||
struct is_invocable_r_impl {
|
||||
using traits = detail::traits<T>;
|
||||
using test = detail::test_invoke<traits>;
|
||||
using result = decltype(test{}(::std::declval<Args>()...));
|
||||
using type = typename std::is_convertible<typename result::_::type, Ret>::type;
|
||||
};
|
||||
|
||||
template<typename Ret, typename T, typename... Args>
|
||||
struct is_invocable_r_impl<std::false_type, Ret, T, Args...> {
|
||||
using type = std::false_type;
|
||||
};
|
||||
|
||||
}}} // namespace boost::callable_traits::detail
|
||||
|
||||
#endif // #ifndef BOOST_CLBL_TRTS_IS_INVOCABLE_IMPL_HPP
|
||||
@@ -0,0 +1,51 @@
|
||||
#ifndef BOOST_CLBL_TRTS_PARAMETER_INDEX_HELPER_HPP
|
||||
#define BOOST_CLBL_TRTS_PARAMETER_INDEX_HELPER_HPP
|
||||
|
||||
#include <boost/callable_traits/detail/config.hpp>
|
||||
|
||||
namespace boost { namespace callable_traits { namespace detail {
|
||||
|
||||
template<std::size_t I, typename T, bool IgnoreThisPointer = false,
|
||||
bool AllowPlus1 = false, std::size_t Count = 0>
|
||||
struct parameter_index_helper {
|
||||
|
||||
using error_t = error_type<T>;
|
||||
|
||||
using args_tuple = typename std::conditional<IgnoreThisPointer,
|
||||
typename detail::traits<T>::non_invoke_arg_types,
|
||||
typename detail::traits<T>::arg_types>::type;
|
||||
|
||||
static constexpr bool has_parameter_list =
|
||||
!std::is_same<args_tuple, invalid_type>::value
|
||||
&& !std::is_same<args_tuple, reference_error>::value;
|
||||
|
||||
using temp_tuple = typename std::conditional<has_parameter_list,
|
||||
args_tuple, std::tuple<error_t>>::type;
|
||||
|
||||
static constexpr std::size_t parameter_list_size =
|
||||
std::tuple_size<temp_tuple>::value;
|
||||
|
||||
static constexpr bool is_out_of_range = has_parameter_list &&
|
||||
I >= parameter_list_size + static_cast<std::size_t>(AllowPlus1);
|
||||
|
||||
static constexpr bool is_count_out_of_range = has_parameter_list &&
|
||||
I + Count > parameter_list_size + static_cast<std::size_t>(AllowPlus1);
|
||||
|
||||
static constexpr std::size_t index =
|
||||
has_parameter_list && !is_out_of_range ? I : 0;
|
||||
|
||||
static constexpr std::size_t count =
|
||||
has_parameter_list && !is_count_out_of_range ? Count : 0;
|
||||
|
||||
using permissive_tuple = typename std::conditional<
|
||||
has_parameter_list && !is_out_of_range,
|
||||
args_tuple, std::tuple<error_t>>::type;
|
||||
|
||||
using permissive_function = typename std::conditional<
|
||||
has_parameter_list && !is_out_of_range,
|
||||
T, error_t(error_t)>::type;
|
||||
};
|
||||
|
||||
}}} // namespace boost::callable_traits::detail
|
||||
|
||||
#endif // #ifndef BOOST_CLBL_TRTS_PARAMETER_INDEX_HELPER_HPP
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
|
||||
@Copyright Barrett Adair 2015-2017
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BOOST_CLBL_TRTS_DETAIL_PMD_HPP
|
||||
#define BOOST_CLBL_TRTS_DETAIL_PMD_HPP
|
||||
|
||||
#include <boost/callable_traits/detail/forward_declarations.hpp>
|
||||
#include <boost/callable_traits/detail/function.hpp>
|
||||
#include <boost/callable_traits/detail/traits.hpp>
|
||||
#include <boost/callable_traits/detail/default_callable_traits.hpp>
|
||||
#include <boost/callable_traits/detail/utility.hpp>
|
||||
|
||||
namespace boost { namespace callable_traits { namespace detail {
|
||||
|
||||
template<typename T>
|
||||
struct pmd : default_callable_traits<T> {};
|
||||
|
||||
template<typename D, typename T>
|
||||
struct pmd<D T::*> : default_callable_traits<> {
|
||||
|
||||
static constexpr bool value = true;
|
||||
|
||||
using traits = pmd;
|
||||
using class_type = T;
|
||||
using invoke_type = T const &;
|
||||
using type = D T::*;
|
||||
using function_type = typename std::add_lvalue_reference<D>::type(invoke_type);
|
||||
using qualified_function_type = D(invoke_type);
|
||||
using arg_types = std::tuple<invoke_type>;
|
||||
using non_invoke_arg_types = std::tuple<>;
|
||||
|
||||
using return_type = typename std::add_lvalue_reference<D>::type;
|
||||
|
||||
template<typename C>
|
||||
using apply_member_pointer = D C::*;
|
||||
|
||||
template<typename R>
|
||||
using apply_return = R T::*;
|
||||
|
||||
template<template<class...> class Container>
|
||||
using expand_args = Container<invoke_type>;
|
||||
|
||||
using is_member_pointer = std::true_type;
|
||||
};
|
||||
|
||||
}}} // namespace boost::callable_traits::detail
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
|
||||
@Copyright Barrett Adair 2015-2017
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BOOST_CLBL_TRTS_DETAIL_PMF_HPP
|
||||
#define BOOST_CLBL_TRTS_DETAIL_PMF_HPP
|
||||
|
||||
#include <boost/callable_traits/detail/forward_declarations.hpp>
|
||||
#include <boost/callable_traits/detail/set_function_qualifiers.hpp>
|
||||
#include <boost/callable_traits/detail/qualifier_flags.hpp>
|
||||
#include <boost/callable_traits/detail/default_callable_traits.hpp>
|
||||
#include <boost/callable_traits/detail/utility.hpp>
|
||||
|
||||
namespace boost { namespace callable_traits { namespace detail {
|
||||
|
||||
template<qualifier_flags Applied, bool IsTransactionSafe, bool IsNoExcept,
|
||||
typename CallingConvention, typename T, typename Return,
|
||||
typename... Args>
|
||||
struct set_member_function_qualifiers_t;
|
||||
|
||||
template<qualifier_flags Applied, bool IsTransactionSafe, bool IsNoexcept,
|
||||
typename CallingConvention, typename T, typename Return,
|
||||
typename... Args>
|
||||
struct set_varargs_member_function_qualifiers_t;
|
||||
|
||||
template<qualifier_flags Flags, bool IsTransactionSafe, bool IsNoexcept,
|
||||
typename... Ts>
|
||||
using set_member_function_qualifiers =
|
||||
typename set_member_function_qualifiers_t<Flags, IsTransactionSafe,
|
||||
IsNoexcept, Ts...>::type;
|
||||
|
||||
template<qualifier_flags Flags, bool IsTransactionSafe, bool IsNoexcept,
|
||||
typename... Ts>
|
||||
using set_varargs_member_function_qualifiers =
|
||||
typename set_varargs_member_function_qualifiers_t<Flags,
|
||||
IsTransactionSafe, IsNoexcept, Ts...>::type;
|
||||
|
||||
template<typename T>
|
||||
struct pmf : default_callable_traits<T> {};
|
||||
|
||||
#define BOOST_CLBL_TRTS_CC_TAG dummy
|
||||
#define BOOST_CLBL_TRTS_VARARGS_CC BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC
|
||||
#define BOOST_CLBL_TRTS_CC
|
||||
#include <boost/callable_traits/detail/unguarded/pmf.hpp>
|
||||
#undef BOOST_CLBL_TRTS_CC
|
||||
#undef BOOST_CLBL_TRTS_CC_TAG
|
||||
#undef BOOST_CLBL_TRTS_VARARGS_CC
|
||||
|
||||
#define BOOST_CLBL_TRTS_CC_TAG dummy
|
||||
#define BOOST_CLBL_TRTS_VARARGS_CC BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC
|
||||
#define BOOST_CLBL_TRTS_CC
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_varargs.hpp>
|
||||
#undef BOOST_CLBL_TRTS_CC
|
||||
#undef BOOST_CLBL_TRTS_CC_TAG
|
||||
#undef BOOST_CLBL_TRTS_VARARGS_CC
|
||||
|
||||
#ifdef BOOST_CLBL_TRTS_ENABLE_CDECL
|
||||
#define BOOST_CLBL_TRTS_CC_TAG cdecl_tag
|
||||
#define BOOST_CLBL_TRTS_VARARGS_CC __cdecl
|
||||
#define BOOST_CLBL_TRTS_CC __cdecl
|
||||
#include <boost/callable_traits/detail/unguarded/pmf.hpp>
|
||||
#undef BOOST_CLBL_TRTS_CC
|
||||
#undef BOOST_CLBL_TRTS_CC_TAG
|
||||
#undef BOOST_CLBL_TRTS_VARARGS_CC
|
||||
#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_CDECL
|
||||
|
||||
// Defining this macro enables undocumented features, likely broken.
|
||||
// Too much work to maintain, but knock yourself out
|
||||
#ifdef BOOST_CLBL_TRTS_ENABLE_STDCALL
|
||||
#define BOOST_CLBL_TRTS_CC_TAG stdcall_tag
|
||||
#define BOOST_CLBL_TRTS_VARARGS_CC BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC
|
||||
#define BOOST_CLBL_TRTS_CC __stdcall
|
||||
#include <boost/callable_traits/detail/unguarded/pmf.hpp>
|
||||
#undef BOOST_CLBL_TRTS_CC
|
||||
#undef BOOST_CLBL_TRTS_CC_TAG
|
||||
#undef BOOST_CLBL_TRTS_VARARGS_CC
|
||||
#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_STDCALL
|
||||
|
||||
// Defining this macro enables undocumented features, likely broken.
|
||||
// Too much work to officially maintain, but knock yourself out
|
||||
#ifdef BOOST_CLBL_TRTS_ENABLE_FASTCALL
|
||||
#define BOOST_CLBL_TRTS_CC_TAG fastcall_tag
|
||||
#define BOOST_CLBL_TRTS_VARARGS_CC BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC
|
||||
#define BOOST_CLBL_TRTS_CC __fastcall
|
||||
#include <boost/callable_traits/detail/unguarded/pmf.hpp>
|
||||
#undef BOOST_CLBL_TRTS_CC
|
||||
#undef BOOST_CLBL_TRTS_CC_TAG
|
||||
#undef BOOST_CLBL_TRTS_VARARGS_CC
|
||||
#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_FASTCALL
|
||||
|
||||
}}} // namespace boost::callable_traits::detail
|
||||
|
||||
#endif // #ifndef BOOST_CLBL_TRTS_DETAIL_PMF_HPP
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright Barrett Adair 2015-2017
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BOOST_CLBL_TRTS_DETAIL_POLYFILLS_DISJUNCTION_HPP
|
||||
#define BOOST_CLBL_TRTS_DETAIL_POLYFILLS_DISJUNCTION_HPP
|
||||
|
||||
#undef BOOST_CLBL_TRTS_DISJUNCTION
|
||||
#define BOOST_CLBL_TRTS_DISJUNCTION(...) \
|
||||
::boost::callable_traits::detail::disjunction<__VA_ARGS__>
|
||||
|
||||
namespace boost { namespace callable_traits { namespace detail {
|
||||
|
||||
//polyfill for C++17 std::disjunction
|
||||
template<typename...>
|
||||
struct disjunction : std::false_type {};
|
||||
|
||||
template<typename T>
|
||||
struct disjunction<T> : T {};
|
||||
|
||||
template<typename T, typename... Ts>
|
||||
struct disjunction<T, Ts...>
|
||||
: std::conditional<T::value != false, T, disjunction<Ts...>>::type {};
|
||||
|
||||
}}} // namespace boost::callable_traits::detail
|
||||
|
||||
#endif // #ifndef BOOST_CLBL_TRTS_DETAIL_POLYFILLS_DISJUNCTION_HPP
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
Copyright Barrett Adair 2016-2017
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#ifndef BOOST_CLBL_TRTS_DETAIL_POLYFILLS_MAKE_INDEX_SEQUENCE_HPP
|
||||
#define BOOST_CLBL_TRTS_DETAIL_POLYFILLS_MAKE_INDEX_SEQUENCE_HPP
|
||||
|
||||
#undef BOOST_CLBL_TRTS_IX_SEQ
|
||||
#define BOOST_CLBL_TRTS_IX_SEQ(...) \
|
||||
::boost::callable_traits::detail::index_sequence<__VA_ARGS__>
|
||||
|
||||
#undef BOOST_CLBL_TRTS_MAKE_IX_SEQ
|
||||
#define BOOST_CLBL_TRTS_MAKE_IX_SEQ(...) \
|
||||
::boost::callable_traits::detail::make_index_sequence<__VA_ARGS__>
|
||||
|
||||
namespace boost { namespace callable_traits { namespace detail {
|
||||
|
||||
template<std::size_t...>
|
||||
struct index_sequence { using type = index_sequence; };
|
||||
|
||||
template<typename, typename>
|
||||
struct concat;
|
||||
|
||||
template<std::size_t... I1, std::size_t... I2>
|
||||
struct concat<index_sequence<I1...>, index_sequence<I2...>>
|
||||
: index_sequence<I1..., (sizeof...(I1)+I2)...> {};
|
||||
|
||||
template<std::size_t N>
|
||||
struct make_index_sequence_t;
|
||||
|
||||
template<std::size_t N>
|
||||
struct make_index_sequence_t : concat<
|
||||
typename make_index_sequence_t<N/2>::type,
|
||||
typename make_index_sequence_t<N - N/2>::type >::type {};
|
||||
|
||||
template<>
|
||||
struct make_index_sequence_t<0> : index_sequence<> {};
|
||||
|
||||
template<>
|
||||
struct make_index_sequence_t<1> : index_sequence<0> {};
|
||||
|
||||
template<std::size_t... I>
|
||||
using make_index_sequence = typename make_index_sequence_t<I...>::type;
|
||||
|
||||
}}} // namespace boost::callable_traits::detail
|
||||
|
||||
#endif // #ifndef BOOST_CLBL_TRTS_DETAIL_POLYFILLS_MAKE_INDEX_SEQUENCE_HPP
|
||||
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
Defines `qualifier_flags`
|
||||
|
||||
@Copyright Barrett Adair 2015-2017
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BOOST_CLBL_TRTS_QUALIFIER_FLAGS_HPP
|
||||
#define BOOST_CLBL_TRTS_QUALIFIER_FLAGS_HPP
|
||||
|
||||
#include <boost/callable_traits/detail/config.hpp>
|
||||
|
||||
namespace boost { namespace callable_traits { namespace detail {
|
||||
|
||||
//bit qualifier_flags used to signify cv/ref qualifiers
|
||||
using qualifier_flags = std::uint32_t;
|
||||
|
||||
/*
|
||||
| && & V C |
|
||||
--------------------------------------------
|
||||
0 | 0 0 0 0 | default
|
||||
1 | 0 0 0 1 | const
|
||||
2 | 0 0 1 0 | volatile
|
||||
3 | 0 0 1 1 | const volatile
|
||||
--------------------------------------------
|
||||
4 | 0 1 0 0 | &
|
||||
5 | 0 1 0 1 | const &
|
||||
6 | 0 1 1 0 | volatile &
|
||||
7 | 0 1 1 1 | const volatile &
|
||||
--------------------------------------------
|
||||
8 | 1 0 0 0 | &&
|
||||
9 | 1 0 0 1 | const &&
|
||||
10 | 1 0 1 0 | volatile &&
|
||||
11 | 1 0 1 1 | const volatile &&
|
||||
|
||||
*/
|
||||
|
||||
// Flag representing the default qualifiers on a type
|
||||
// or member function overload.
|
||||
constexpr qualifier_flags default_ = 0;
|
||||
|
||||
// Flag representing a const qualifier on a type or
|
||||
// member function overload.
|
||||
constexpr qualifier_flags const_ = 1;
|
||||
|
||||
// Flag representing a volatile qualifier on a type
|
||||
// or member function overload.
|
||||
constexpr qualifier_flags volatile_ = 2;
|
||||
|
||||
#ifdef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS
|
||||
|
||||
constexpr qualifier_flags lref_ = default_;
|
||||
constexpr qualifier_flags rref_ = default_;
|
||||
#else
|
||||
|
||||
// Flag representing an lvalue reference type, or
|
||||
// an lvalue-reference-qualified member function
|
||||
// overload.
|
||||
constexpr qualifier_flags lref_ = 4;
|
||||
|
||||
// Flag representing an lvalue reference type, or
|
||||
// an rvalue-reference-qualified member function
|
||||
// overload.
|
||||
constexpr qualifier_flags rref_ = 8;
|
||||
|
||||
#endif //#ifdef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS
|
||||
|
||||
constexpr qualifier_flags cv_ = 3;
|
||||
|
||||
template<qualifier_flags Flags>
|
||||
using remove_const_flag = std::integral_constant<
|
||||
qualifier_flags, Flags & ~const_>;
|
||||
|
||||
template<qualifier_flags Flags>
|
||||
using is_const = std::integral_constant<bool,
|
||||
(Flags & const_) != 0>;
|
||||
|
||||
template<qualifier_flags Flags>
|
||||
using remove_volatile_flag = std::integral_constant<
|
||||
qualifier_flags, Flags & ~volatile_>;
|
||||
|
||||
template<typename U, typename T = typename std::remove_reference<U>::type>
|
||||
using cv_of = std::integral_constant<qualifier_flags,
|
||||
(std::is_const<T>::value ? const_ : default_)
|
||||
| (std::is_volatile<T>::value ? volatile_ : default_)>;
|
||||
|
||||
template<typename T>
|
||||
using ref_of = std::integral_constant<qualifier_flags,
|
||||
std::is_rvalue_reference<T>::value ? rref_
|
||||
: (std::is_lvalue_reference<T>::value ? lref_
|
||||
: default_)>;
|
||||
|
||||
//bit-flag implementation of C++11 reference collapsing rules
|
||||
template<qualifier_flags Existing,
|
||||
qualifier_flags Other,
|
||||
bool AlreadyHasRef = (Existing & (lref_ | rref_)) != 0,
|
||||
bool AlreadyHasLRef = (Existing & lref_) == lref_,
|
||||
bool IsAddingLRef = (Other & lref_) == lref_
|
||||
>
|
||||
using collapse_flags = std::integral_constant<qualifier_flags,
|
||||
!AlreadyHasRef ? (Existing | Other)
|
||||
: (AlreadyHasLRef ? (Existing | (Other & ~rref_))
|
||||
: (IsAddingLRef ? ((Existing & ~rref_) | Other )
|
||||
: (Existing | Other)))>;
|
||||
|
||||
template<typename T> struct flag_map { static constexpr qualifier_flags value = default_; };
|
||||
template<typename T> struct flag_map<T &> { static constexpr qualifier_flags value = lref_; };
|
||||
template<typename T> struct flag_map<T &&> { static constexpr qualifier_flags value = rref_; };
|
||||
template<typename T> struct flag_map<T const> { static constexpr qualifier_flags value = const_; };
|
||||
template<typename T> struct flag_map<T const &> { static constexpr qualifier_flags value = const_ | lref_; };
|
||||
template<typename T> struct flag_map<T const &&> { static constexpr qualifier_flags value = const_ | rref_; };
|
||||
template<typename T> struct flag_map<T volatile> { static constexpr qualifier_flags value = volatile_; };
|
||||
template<typename T> struct flag_map<T volatile &> { static constexpr qualifier_flags value = volatile_ | lref_; };
|
||||
template<typename T> struct flag_map<T volatile &&> { static constexpr qualifier_flags value = volatile_ | rref_; };
|
||||
template<typename T> struct flag_map<T const volatile> { static constexpr qualifier_flags value = const_ | volatile_; };
|
||||
template<typename T> struct flag_map<T const volatile &> { static constexpr qualifier_flags value = const_ | volatile_ | lref_; };
|
||||
template<typename T> struct flag_map<T const volatile &&> { static constexpr qualifier_flags value = const_ | volatile_ | rref_; };
|
||||
|
||||
}}} // namespace boost::callable_traits::detail
|
||||
|
||||
#endif // #ifndef BOOST_CLBL_TRTS_QUALIFIER_FLAGS_HPP
|
||||
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
|
||||
@Copyright Barrett Adair 2015-2017
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BOOST_CLBL_TRTS_DETAIL_SET_FUNCTION_QUALIFIERS_HPP
|
||||
#define BOOST_CLBL_TRTS_DETAIL_SET_FUNCTION_QUALIFIERS_HPP
|
||||
|
||||
#include <boost/callable_traits/detail/qualifier_flags.hpp>
|
||||
|
||||
#define BOOST_CLBL_TRTS_SET_FUNCTION_QUALIFIERS(QUAL) \
|
||||
template<typename Return, typename... Args> \
|
||||
struct set_function_qualifiers_t < \
|
||||
flag_map<int QUAL>::value, false, false, Return, Args...> { \
|
||||
using type = Return(Args...) QUAL; \
|
||||
}; \
|
||||
\
|
||||
template<typename Return, typename... Args> \
|
||||
struct set_function_qualifiers_t < \
|
||||
flag_map<int QUAL>::value, true, false, Return, Args...> { \
|
||||
using type = Return(Args...) QUAL \
|
||||
BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER; \
|
||||
}; \
|
||||
\
|
||||
template<typename Return, typename... Args> \
|
||||
struct set_function_qualifiers_t < \
|
||||
flag_map<int QUAL>::value, false, true, Return, Args...> { \
|
||||
using type = Return(Args...) QUAL \
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER; \
|
||||
}; \
|
||||
\
|
||||
template<typename Return, typename... Args> \
|
||||
struct set_function_qualifiers_t < \
|
||||
flag_map<int QUAL>::value, true, true, Return, Args...> { \
|
||||
using type = Return(Args...) QUAL \
|
||||
BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER \
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER; \
|
||||
}; \
|
||||
\
|
||||
template<typename Return, typename... Args> \
|
||||
struct set_varargs_function_qualifiers_t < \
|
||||
flag_map<int QUAL>::value, false, false, Return, Args...> { \
|
||||
using type = Return(Args..., ...) QUAL; \
|
||||
}; \
|
||||
\
|
||||
template<typename Return, typename... Args> \
|
||||
struct set_varargs_function_qualifiers_t < \
|
||||
flag_map<int QUAL>::value, true, false, Return, Args...> { \
|
||||
using type = Return(Args..., ...) QUAL \
|
||||
BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER; \
|
||||
}; \
|
||||
\
|
||||
template<typename Return, typename... Args> \
|
||||
struct set_varargs_function_qualifiers_t < \
|
||||
flag_map<int QUAL>::value, false, true, Return, Args...> { \
|
||||
using type = Return(Args..., ...) QUAL \
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER; \
|
||||
}; \
|
||||
\
|
||||
template<typename Return, typename... Args> \
|
||||
struct set_varargs_function_qualifiers_t < \
|
||||
flag_map<int QUAL>::value, true, true, Return, Args...> { \
|
||||
using type = Return(Args..., ...) QUAL \
|
||||
BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER \
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER; \
|
||||
} \
|
||||
/**/
|
||||
|
||||
namespace boost { namespace callable_traits { namespace detail {
|
||||
|
||||
template<qualifier_flags Applied, bool IsTransactionSafe,
|
||||
bool IsNoexcept, typename Return, typename... Args>
|
||||
struct set_function_qualifiers_t {
|
||||
using type = Return(Args...);
|
||||
};
|
||||
|
||||
template<qualifier_flags Applied, bool IsTransactionSafe,
|
||||
bool IsNoexcept, typename Return, typename... Args>
|
||||
struct set_varargs_function_qualifiers_t {
|
||||
using type = Return(Args..., ...);
|
||||
};
|
||||
|
||||
#ifndef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
|
||||
|
||||
BOOST_CLBL_TRTS_SET_FUNCTION_QUALIFIERS(const);
|
||||
BOOST_CLBL_TRTS_SET_FUNCTION_QUALIFIERS(volatile);
|
||||
BOOST_CLBL_TRTS_SET_FUNCTION_QUALIFIERS(const volatile);
|
||||
|
||||
#ifndef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS
|
||||
|
||||
BOOST_CLBL_TRTS_SET_FUNCTION_QUALIFIERS(&);
|
||||
BOOST_CLBL_TRTS_SET_FUNCTION_QUALIFIERS(&&);
|
||||
BOOST_CLBL_TRTS_SET_FUNCTION_QUALIFIERS(const &);
|
||||
BOOST_CLBL_TRTS_SET_FUNCTION_QUALIFIERS(const &&);
|
||||
BOOST_CLBL_TRTS_SET_FUNCTION_QUALIFIERS(volatile &);
|
||||
BOOST_CLBL_TRTS_SET_FUNCTION_QUALIFIERS(volatile &&);
|
||||
BOOST_CLBL_TRTS_SET_FUNCTION_QUALIFIERS(const volatile &);
|
||||
BOOST_CLBL_TRTS_SET_FUNCTION_QUALIFIERS(const volatile &&);
|
||||
|
||||
#endif // #ifndef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS
|
||||
#endif // #ifndef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
|
||||
|
||||
template<qualifier_flags Flags, bool IsTransactionSafe, bool IsNoexcept,
|
||||
typename... Ts>
|
||||
using set_function_qualifiers =
|
||||
typename set_function_qualifiers_t<Flags, IsTransactionSafe, IsNoexcept,
|
||||
Ts...>::type;
|
||||
|
||||
template<qualifier_flags Flags, bool IsTransactionSafe, bool IsNoexcept,
|
||||
typename... Ts>
|
||||
using set_varargs_function_qualifiers =
|
||||
typename set_varargs_function_qualifiers_t<Flags, IsTransactionSafe,
|
||||
IsNoexcept, Ts...>::type;
|
||||
|
||||
}}} // namespace boost::callable_traits::detail
|
||||
|
||||
#endif //BOOST_CLBL_TRTS_DETAIL_SET_FUNCTION_QUALIFIERS_HPP
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
@Copyright Barrett Adair 2016-2017
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BOOST_CLBL_TRTS_SFINAE_ERRORS_HPP
|
||||
#define BOOST_CLBL_TRTS_SFINAE_ERRORS_HPP
|
||||
|
||||
#include <boost/callable_traits/detail/config.hpp>
|
||||
|
||||
namespace boost { namespace callable_traits { namespace detail {
|
||||
|
||||
struct sfinae_error{};
|
||||
|
||||
template<typename T>
|
||||
struct success {
|
||||
static constexpr bool value = true;
|
||||
struct _ { using type = T; };
|
||||
};
|
||||
|
||||
template<bool B, typename T>
|
||||
struct fail_if : T {
|
||||
static_assert(std::is_base_of<sfinae_error, T>::value,
|
||||
"incorrect usage of fail_if");
|
||||
|
||||
static constexpr bool value = B;
|
||||
};
|
||||
|
||||
template<typename T, typename... FailIfs>
|
||||
using sfinae_try = typename BOOST_CLBL_TRTS_DISJUNCTION(
|
||||
FailIfs..., success<T>)::_::type;
|
||||
|
||||
template<typename FailMsg, typename ForceTwoPhaseLookup>
|
||||
struct fail {
|
||||
using type = typename std::conditional<std::is_same<ForceTwoPhaseLookup, std::false_type>::value,
|
||||
FailMsg, FailMsg>::type::_::type;
|
||||
};
|
||||
|
||||
}}} // namespace boost::callable_traits::detail
|
||||
|
||||
#define BOOST_CLBL_TRTS_PP_CAT_(x, y) x ## y
|
||||
#define BOOST_CLBL_TRTS_PP_CAT(x, y) BOOST_CLBL_TRTS_PP_CAT_(x, y)
|
||||
|
||||
#define BOOST_CLBL_TRTS_DEFINE_SFINAE_ERROR_ORIGIN(origin) \
|
||||
namespace error { \
|
||||
template<typename ErrorMessage> \
|
||||
struct origin : \
|
||||
::boost::callable_traits::detail::sfinae_error \
|
||||
{ struct _ {}; }; \
|
||||
} \
|
||||
/**/
|
||||
|
||||
#define BOOST_CLBL_TRTS_SFINAE_MSG(origin, name) \
|
||||
struct BOOST_CLBL_TRTS_PP_CAT(name, _ ){}; \
|
||||
struct name : error::origin< \
|
||||
BOOST_CLBL_TRTS_PP_CAT(name, _ )>{}; \
|
||||
/**/
|
||||
|
||||
namespace boost { namespace callable_traits {
|
||||
|
||||
BOOST_CLBL_TRTS_DEFINE_SFINAE_ERROR_ORIGIN(parameters)
|
||||
BOOST_CLBL_TRTS_SFINAE_MSG(parameters, index_out_of_range_for_parameter_list)
|
||||
BOOST_CLBL_TRTS_SFINAE_MSG(parameters, cannot_determine_parameters_for_this_type)
|
||||
|
||||
BOOST_CLBL_TRTS_DEFINE_SFINAE_ERROR_ORIGIN(varargs)
|
||||
BOOST_CLBL_TRTS_SFINAE_MSG(varargs, varargs_are_illegal_for_this_type)
|
||||
|
||||
BOOST_CLBL_TRTS_DEFINE_SFINAE_ERROR_ORIGIN(member_qualifiers)
|
||||
BOOST_CLBL_TRTS_SFINAE_MSG(member_qualifiers, member_qualifiers_are_illegal_for_this_type)
|
||||
BOOST_CLBL_TRTS_SFINAE_MSG(member_qualifiers, this_compiler_doesnt_support_abominable_function_types)
|
||||
|
||||
BOOST_CLBL_TRTS_DEFINE_SFINAE_ERROR_ORIGIN(transaction_safe_)
|
||||
BOOST_CLBL_TRTS_SFINAE_MSG(transaction_safe_, transaction_safe_is_not_supported_by_this_configuration)
|
||||
|
||||
BOOST_CLBL_TRTS_DEFINE_SFINAE_ERROR_ORIGIN(expand_args)
|
||||
BOOST_CLBL_TRTS_SFINAE_MSG(expand_args, cannot_expand_the_parameter_list_of_first_template_argument)
|
||||
|
||||
BOOST_CLBL_TRTS_DEFINE_SFINAE_ERROR_ORIGIN(member_pointer_required)
|
||||
BOOST_CLBL_TRTS_SFINAE_MSG(member_pointer_required, type_is_not_a_member_pointer)
|
||||
|
||||
BOOST_CLBL_TRTS_DEFINE_SFINAE_ERROR_ORIGIN(reference_error)
|
||||
BOOST_CLBL_TRTS_SFINAE_MSG(reference_error, reference_type_not_supported_by_this_metafunction)
|
||||
|
||||
}} // namespace boost::callable_traits
|
||||
|
||||
#endif // #ifndef BOOST_CLBL_TRTS_SFINAE_ERRORS_HPP
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
|
||||
@Copyright Barrett Adair 2015-2017
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BOOST_CLBL_TRTS_DETAIL_TRAITS_HPP
|
||||
#define BOOST_CLBL_TRTS_DETAIL_TRAITS_HPP
|
||||
|
||||
#include <boost/callable_traits/detail/forward_declarations.hpp>
|
||||
#include <boost/callable_traits/detail/utility.hpp>
|
||||
|
||||
namespace boost { namespace callable_traits { namespace detail {
|
||||
|
||||
// Here is where the magic happens
|
||||
template<typename T>
|
||||
using traits = typename BOOST_CLBL_TRTS_DISJUNCTION(
|
||||
function_object<unwrap_reference<T>>,
|
||||
function<T>,
|
||||
pmf<T>,
|
||||
pmd<T>,
|
||||
default_callable_traits<T>
|
||||
)::traits;
|
||||
|
||||
}}} // namespace boost::callable_traits::detail
|
||||
|
||||
#endif // #ifndef BOOST_CLBL_TRTS_DETAIL_TRAITS_HPP
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
Copyright (c) 2016 Barrett Adair
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
HEADER GUARDS INTENTIONALLY OMITTED
|
||||
DO NOT INCLUDE THIS HEADER DIRECTLY
|
||||
*/
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE std::false_type
|
||||
#include <boost/callable_traits/detail/unguarded/function_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
#undef BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE
|
||||
|
||||
#ifdef BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE
|
||||
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE std::true_type
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE transaction_safe
|
||||
#include <boost/callable_traits/detail/unguarded/function_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
#undef BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE
|
||||
#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
Copyright (c) 2016 Barrett Adair
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
HEADER GUARDS INTENTIONALLY OMITTED
|
||||
DO NOT INCLUDE THIS HEADER DIRECTLY
|
||||
*/
|
||||
|
||||
#define BOOST_CLBL_TRTS_NOEXCEPT_SPEC
|
||||
#define BOOST_CLBL_TRTS_IS_NOEXCEPT std::false_type
|
||||
#include <boost/callable_traits/detail/unguarded/function_3.hpp>
|
||||
#undef BOOST_CLBL_TRTS_NOEXCEPT_SPEC
|
||||
#undef BOOST_CLBL_TRTS_IS_NOEXCEPT
|
||||
|
||||
#ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
|
||||
#define BOOST_CLBL_TRTS_NOEXCEPT_SPEC noexcept
|
||||
#define BOOST_CLBL_TRTS_IS_NOEXCEPT std::true_type
|
||||
#include <boost/callable_traits/detail/unguarded/function_3.hpp>
|
||||
#undef BOOST_CLBL_TRTS_NOEXCEPT_SPEC
|
||||
#undef BOOST_CLBL_TRTS_IS_NOEXCEPT
|
||||
#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
|
||||
@@ -0,0 +1,260 @@
|
||||
/*
|
||||
Copyright (c) 2016 Barrett Adair
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
HEADER GUARDS INTENTIONALLY OMITTED
|
||||
DO NOT INCLUDE THIS HEADER DIRECTLY
|
||||
|
||||
macros used:
|
||||
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS - the function-level qualifiers for the
|
||||
current inclusion (combinations of `const` `volatile` `&` `&&`, or nothing)
|
||||
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE - the transaction_safe specifier for
|
||||
the current include (`transaction_safe` or nothing)
|
||||
|
||||
BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE - `std::true_type` or `std::false_type`,
|
||||
tied on whether BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE is `transaction_safe`
|
||||
|
||||
BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER - `transaction_safe` when
|
||||
BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE is enabled, otherwise nothing
|
||||
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC - the noexcept specifier for
|
||||
the current include (`noexcept` or nothing)
|
||||
|
||||
BOOST_CLBL_TRTS_IS_NOEXCEPT - `std::true_type` or `std::false_type`,
|
||||
tied on whether BOOST_CLBL_TRTS_NOEXCEPT_SPEC is `noexcept`
|
||||
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER - `noexcept` if
|
||||
BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES is defined, otherwise nothing
|
||||
|
||||
*/
|
||||
|
||||
template<typename Return, typename... Args>
|
||||
struct function<Return(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC>
|
||||
: default_callable_traits<dummy BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS> {
|
||||
|
||||
static constexpr bool value = true;
|
||||
|
||||
using traits = function;
|
||||
|
||||
using return_type = Return;
|
||||
|
||||
using arg_types = std::tuple<Args...>;
|
||||
using non_invoke_arg_types = arg_types;
|
||||
|
||||
using type = Return(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using function_type = Return(Args...);
|
||||
|
||||
using qualified_function_type = Return(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using remove_varargs = type;
|
||||
|
||||
using add_varargs = Return (Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using is_noexcept = BOOST_CLBL_TRTS_IS_NOEXCEPT;
|
||||
|
||||
using remove_noexcept = Return(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE;
|
||||
|
||||
using add_noexcept = Return(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER;
|
||||
|
||||
using is_transaction_safe = BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE;
|
||||
|
||||
using remove_transaction_safe = Return(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using add_transaction_safe = Return(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using qualifiers = default_callable_traits<dummy BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>;
|
||||
|
||||
template<qualifier_flags Flags>
|
||||
using set_qualifiers = set_function_qualifiers<Flags, is_transaction_safe::value,
|
||||
is_noexcept::value, Return, Args...>;
|
||||
|
||||
#ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
|
||||
|
||||
using add_member_lvalue_reference = abominable_functions_not_supported_on_this_compiler;
|
||||
using add_member_rvalue_reference = abominable_functions_not_supported_on_this_compiler;
|
||||
using add_member_const = abominable_functions_not_supported_on_this_compiler;
|
||||
using add_member_volatile = abominable_functions_not_supported_on_this_compiler;
|
||||
using add_member_cv = abominable_functions_not_supported_on_this_compiler;
|
||||
|
||||
#else
|
||||
|
||||
using add_member_lvalue_reference = set_qualifiers<
|
||||
collapse_flags<qualifiers::q_flags, lref_>::value>;
|
||||
|
||||
using add_member_rvalue_reference = set_qualifiers<
|
||||
collapse_flags<qualifiers::q_flags, rref_>::value>;
|
||||
|
||||
using add_member_const = set_qualifiers<qualifiers::q_flags | const_>;
|
||||
|
||||
using add_member_volatile = set_qualifiers<qualifiers::q_flags | volatile_>;
|
||||
|
||||
using add_member_cv = set_qualifiers<qualifiers::q_flags | cv_>;
|
||||
|
||||
#endif // #ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
|
||||
|
||||
using remove_member_reference = set_qualifiers<qualifiers::cv_flags>;
|
||||
|
||||
using remove_member_const = set_qualifiers<
|
||||
qualifiers::ref_flags | remove_const_flag<qualifiers::cv_flags>::value>;
|
||||
|
||||
using remove_member_volatile = set_qualifiers<
|
||||
qualifiers::ref_flags | remove_volatile_flag<qualifiers::cv_flags>::value>;
|
||||
|
||||
using remove_member_cv = set_qualifiers<qualifiers::ref_flags>;
|
||||
|
||||
template<typename U>
|
||||
using apply_member_pointer = add_member_pointer<type, U>;
|
||||
|
||||
template<typename NewReturn>
|
||||
using apply_return = NewReturn(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
template<template<class...> class Container>
|
||||
using expand_args = Container<Args...>;
|
||||
|
||||
using is_member_pointer = std::false_type;
|
||||
};
|
||||
|
||||
|
||||
template<typename Return, typename... Args>
|
||||
struct function<Return (Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC>
|
||||
: default_callable_traits<dummy BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS> {
|
||||
|
||||
static constexpr bool value = true;
|
||||
|
||||
using has_varargs = std::true_type;
|
||||
using traits = function;
|
||||
using return_type = Return;
|
||||
using arg_types = std::tuple<Args...>;
|
||||
|
||||
using type = Return (Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using function_type = Return(Args..., ...);
|
||||
|
||||
using qualified_function_type = Return(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using remove_varargs = Return (Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using add_varargs = type;
|
||||
|
||||
using is_noexcept = BOOST_CLBL_TRTS_IS_NOEXCEPT;
|
||||
|
||||
using remove_noexcept = Return(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE;
|
||||
|
||||
using add_noexcept = Return(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER;
|
||||
|
||||
using is_transaction_safe = BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE;
|
||||
|
||||
using remove_transaction_safe = Return(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using add_transaction_safe = Return(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using qualifiers = default_callable_traits<dummy BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>;
|
||||
|
||||
template<qualifier_flags Flags>
|
||||
using set_qualifiers = set_varargs_function_qualifiers<Flags, is_transaction_safe::value,
|
||||
is_noexcept::value, Return, Args...>;
|
||||
|
||||
#ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
|
||||
|
||||
using add_member_lvalue_reference = abominable_functions_not_supported_on_this_compiler;
|
||||
using add_member_rvalue_reference = abominable_functions_not_supported_on_this_compiler;
|
||||
using add_member_const = abominable_functions_not_supported_on_this_compiler;
|
||||
using add_member_volatile = abominable_functions_not_supported_on_this_compiler;
|
||||
using add_member_cv = abominable_functions_not_supported_on_this_compiler;
|
||||
|
||||
#else
|
||||
|
||||
using add_member_lvalue_reference = set_qualifiers<
|
||||
collapse_flags<qualifiers::q_flags, lref_>::value>;
|
||||
|
||||
using add_member_rvalue_reference = set_qualifiers<
|
||||
collapse_flags<qualifiers::q_flags, rref_>::value>;
|
||||
|
||||
using add_member_const = set_qualifiers<qualifiers::q_flags | const_>;
|
||||
|
||||
using add_member_volatile = set_qualifiers<qualifiers::q_flags | volatile_>;
|
||||
|
||||
using add_member_cv = set_qualifiers<qualifiers::q_flags | cv_>;
|
||||
|
||||
#endif // #ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
|
||||
|
||||
using remove_member_reference = set_qualifiers<qualifiers::cv_flags>;
|
||||
|
||||
using remove_member_const = set_qualifiers<
|
||||
qualifiers::ref_flags | remove_const_flag<qualifiers::cv_flags>::value>;
|
||||
|
||||
using remove_member_volatile = set_qualifiers<
|
||||
qualifiers::ref_flags | remove_volatile_flag<qualifiers::cv_flags>::value>;
|
||||
|
||||
using remove_member_cv = set_qualifiers<qualifiers::ref_flags>;
|
||||
|
||||
template<typename U>
|
||||
using apply_member_pointer =
|
||||
Return( BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC U::*)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
template<typename NewReturn>
|
||||
using apply_return = NewReturn(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
template<template<class...> class Container>
|
||||
using expand_args = Container<Args...>;
|
||||
|
||||
using is_member_pointer = std::false_type;
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
Copyright (c) 2016 Modified Work Barrett Adair
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
HEADER GUARDS INTENTIONALLY OMITTED
|
||||
DO NOT INCLUDE THIS HEADER DIRECTLY
|
||||
*/
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE std::false_type
|
||||
#include <boost/callable_traits/detail/unguarded/function_ptr_2.hpp>
|
||||
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
#undef BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE
|
||||
|
||||
#ifdef BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE
|
||||
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE std::true_type
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE transaction_safe
|
||||
#include <boost/callable_traits/detail/unguarded/function_ptr_2.hpp>
|
||||
#endif
|
||||
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
#undef BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
Copyright (c) 2016 Barrett Adair
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
HEADER GUARDS INTENTIONALLY OMITTED
|
||||
DO NOT INCLUDE THIS HEADER DIRECTLY
|
||||
*/
|
||||
|
||||
#define BOOST_CLBL_TRTS_NOEXCEPT_SPEC
|
||||
#define BOOST_CLBL_TRTS_IS_NOEXCEPT std::false_type
|
||||
#include <boost/callable_traits/detail/unguarded/function_ptr_3.hpp>
|
||||
#undef BOOST_CLBL_TRTS_NOEXCEPT_SPEC
|
||||
#undef BOOST_CLBL_TRTS_IS_NOEXCEPT
|
||||
|
||||
#ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
|
||||
#define BOOST_CLBL_TRTS_NOEXCEPT_SPEC noexcept
|
||||
#define BOOST_CLBL_TRTS_IS_NOEXCEPT std::true_type
|
||||
#include <boost/callable_traits/detail/unguarded/function_ptr_3.hpp>
|
||||
#undef BOOST_CLBL_TRTS_NOEXCEPT_SPEC
|
||||
#undef BOOST_CLBL_TRTS_IS_NOEXCEPT
|
||||
#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
|
||||
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
Copyright (c) 2016 Modified Work Barrett Adair
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
HEADER GUARDS INTENTIONALLY OMITTED
|
||||
DO NOT INCLUDE THIS HEADER DIRECTLY
|
||||
|
||||
macros used:
|
||||
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE - the transaction_safe specifier for
|
||||
the current include (`transaction_safe` or nothing)
|
||||
|
||||
BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE - `std::true_type` or `std::false_type`,
|
||||
tied on whether BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE is `transaction_safe`
|
||||
|
||||
BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER - `transaction_safe` when
|
||||
BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE is enabled, otherwise nothing
|
||||
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC - the noexcept specifier for
|
||||
the current include (`noexcept` or nothing)
|
||||
|
||||
BOOST_CLBL_TRTS_IS_NOEXCEPT - `std::true_type` or `std::false_type`,
|
||||
tied on whether BOOST_CLBL_TRTS_NOEXCEPT_SPEC is `noexcept`
|
||||
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER - `noexcept` if
|
||||
BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES is defined, otherwise nothing
|
||||
*/
|
||||
|
||||
template<typename Return, typename... Args>
|
||||
struct function<
|
||||
BOOST_CLBL_TRTS_ST Return(BOOST_CLBL_TRTS_CC *)(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC>
|
||||
: default_callable_traits<> {
|
||||
|
||||
static constexpr bool value = true;
|
||||
|
||||
using traits = function;
|
||||
|
||||
using return_type = Return;
|
||||
|
||||
using arg_types = std::tuple<Args...>;
|
||||
using non_invoke_arg_types = arg_types;
|
||||
|
||||
using type = BOOST_CLBL_TRTS_ST Return(BOOST_CLBL_TRTS_CC *)(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE;
|
||||
|
||||
using function_type = Return(Args...);
|
||||
using qualified_function_type = function_type;
|
||||
using remove_varargs = type;
|
||||
|
||||
using add_varargs =
|
||||
BOOST_CLBL_TRTS_ST Return (BOOST_CLBL_TRTS_VARARGS_CC *)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using is_noexcept = BOOST_CLBL_TRTS_IS_NOEXCEPT;
|
||||
|
||||
using remove_noexcept = Return(BOOST_CLBL_TRTS_CC *)(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE;
|
||||
|
||||
using add_noexcept = Return(BOOST_CLBL_TRTS_CC *)(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER;
|
||||
|
||||
using is_transaction_safe = BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE;
|
||||
|
||||
using remove_transaction_safe = Return(BOOST_CLBL_TRTS_CC *)(Args...)
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using add_transaction_safe = Return(BOOST_CLBL_TRTS_CC *)(Args...)
|
||||
BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
template<typename U>
|
||||
using apply_member_pointer =
|
||||
BOOST_CLBL_TRTS_ST Return(BOOST_CLBL_TRTS_CC U::*)(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
template<typename NewReturn>
|
||||
using apply_return =
|
||||
BOOST_CLBL_TRTS_ST NewReturn(BOOST_CLBL_TRTS_CC *)(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
template<template<class...> class Container>
|
||||
using expand_args = Container<Args...>;
|
||||
|
||||
using is_member_pointer = std::false_type;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
Copyright (c) 2016 Modified Work Barrett Adair
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
HEADER GUARDS INTENTIONALLY OMITTED
|
||||
DO NOT INCLUDE THIS HEADER DIRECTLY
|
||||
*/
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE std::false_type
|
||||
#include <boost/callable_traits/detail/unguarded/function_ptr_varargs_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
#undef BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE
|
||||
|
||||
#ifdef BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE
|
||||
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE std::true_type
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE transaction_safe
|
||||
#include <boost/callable_traits/detail/unguarded/function_ptr_varargs_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
#undef BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE
|
||||
#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
Copyright (c) 2016 Barrett Adair
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
HEADER GUARDS INTENTIONALLY OMITTED
|
||||
DO NOT INCLUDE THIS HEADER DIRECTLY
|
||||
*/
|
||||
|
||||
#define BOOST_CLBL_TRTS_NOEXCEPT_SPEC
|
||||
#define BOOST_CLBL_TRTS_IS_NOEXCEPT std::false_type
|
||||
#include <boost/callable_traits/detail/unguarded/function_ptr_varargs_3.hpp>
|
||||
#undef BOOST_CLBL_TRTS_NOEXCEPT_SPEC
|
||||
#undef BOOST_CLBL_TRTS_IS_NOEXCEPT
|
||||
|
||||
#ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
|
||||
#define BOOST_CLBL_TRTS_NOEXCEPT_SPEC noexcept
|
||||
#define BOOST_CLBL_TRTS_IS_NOEXCEPT std::true_type
|
||||
#include <boost/callable_traits/detail/unguarded/function_ptr_varargs_3.hpp>
|
||||
#undef BOOST_CLBL_TRTS_NOEXCEPT_SPEC
|
||||
#undef BOOST_CLBL_TRTS_IS_NOEXCEPT
|
||||
#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
|
||||
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
Copyright (c) 2016 Modified Work Barrett Adair
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
HEADER GUARDS INTENTIONALLY OMITTED
|
||||
DO NOT INCLUDE THIS HEADER DIRECTLY
|
||||
|
||||
macros used:
|
||||
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE - the transaction_safe specifier for
|
||||
the current include (`transaction_safe` or nothing)
|
||||
|
||||
BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE - `std::true_type` or `std::false_type`,
|
||||
tied on whether BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE is `transaction_safe`
|
||||
|
||||
BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER - `transaction_safe` when
|
||||
BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE is enabled, otherwise nothing
|
||||
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC - the noexcept specifier for
|
||||
the current include (`noexcept` or nothing)
|
||||
|
||||
BOOST_CLBL_TRTS_IS_NOEXCEPT - `std::true_type` or `std::false_type`,
|
||||
tied on whether BOOST_CLBL_TRTS_NOEXCEPT_SPEC is `noexcept`
|
||||
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER - `noexcept` if
|
||||
BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES is defined, otherwise nothing
|
||||
*/
|
||||
|
||||
template<typename Return, typename... Args>
|
||||
struct function<BOOST_CLBL_TRTS_ST Return(BOOST_CLBL_TRTS_VARARGS_CC *)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC>
|
||||
: default_callable_traits<> {
|
||||
|
||||
static constexpr bool value = true;
|
||||
|
||||
using has_varargs = std::true_type;
|
||||
|
||||
using traits = function;
|
||||
|
||||
using return_type = Return;
|
||||
|
||||
using arg_types = std::tuple<Args...>;
|
||||
using non_invoke_arg_types = arg_types;
|
||||
|
||||
using type =
|
||||
BOOST_CLBL_TRTS_ST Return(BOOST_CLBL_TRTS_VARARGS_CC *)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using function_type = Return(Args..., ...);
|
||||
|
||||
using qualified_function_type = function_type;
|
||||
|
||||
using remove_varargs =
|
||||
BOOST_CLBL_TRTS_ST Return(BOOST_CLBL_TRTS_CC *)(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE;
|
||||
|
||||
using add_varargs = type;
|
||||
|
||||
using is_noexcept = BOOST_CLBL_TRTS_IS_NOEXCEPT;
|
||||
|
||||
using remove_noexcept = BOOST_CLBL_TRTS_ST Return(BOOST_CLBL_TRTS_CC *)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE;
|
||||
|
||||
using add_noexcept = BOOST_CLBL_TRTS_ST Return(BOOST_CLBL_TRTS_CC *)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER;
|
||||
|
||||
using is_transaction_safe = BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE;
|
||||
|
||||
using remove_transaction_safe = Return(BOOST_CLBL_TRTS_VARARGS_CC *)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using add_transaction_safe = Return(BOOST_CLBL_TRTS_VARARGS_CC *)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
template<typename U>
|
||||
using apply_member_pointer =
|
||||
BOOST_CLBL_TRTS_ST Return(BOOST_CLBL_TRTS_VARARGS_CC U::*)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
template<typename NewReturn>
|
||||
using apply_return =
|
||||
BOOST_CLBL_TRTS_ST NewReturn(BOOST_CLBL_TRTS_VARARGS_CC *)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
template<template<class...> class Container>
|
||||
using expand_args = Container<Args...>;
|
||||
|
||||
using is_member_pointer = std::false_type;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
Copyright (c) 2001 Peter Dimov and Multi Media Ltd.
|
||||
Copyright (c) 2016 Modified Work Barrett Adair
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
HEADER GUARDS INTENTIONALLY OMITTED
|
||||
DO NOT INCLUDE THIS HEADER DIRECTLY
|
||||
|
||||
*/
|
||||
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS const
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS \
|
||||
BOOST_CLBL_TRTS_ABOMINABLE_CONST
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS volatile
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS \
|
||||
BOOST_CLBL_TRTS_ABOMINABLE_VOLATILE
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS const volatile
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS \
|
||||
BOOST_CLBL_TRTS_ABOMINABLE_CONST BOOST_CLBL_TRTS_ABOMINABLE_VOLATILE
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#ifndef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS &
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS &
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS &&
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS &&
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS const &
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS const &
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS volatile &
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS volatile &
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS const volatile &
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS const volatile &
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS const &&
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS const &&
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS volatile &&
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS volatile &&
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS const volatile &&
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS const volatile &&
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#endif // #ifndef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
Copyright (c) 2016 Barrett Adair
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
HEADER GUARDS INTENTIONALLY OMITTED
|
||||
DO NOT INCLUDE THIS HEADER DIRECTLY
|
||||
|
||||
*/
|
||||
|
||||
template<typename Return, typename T, typename... Args>
|
||||
struct set_member_function_qualifiers_t<
|
||||
flag_map<int BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>::value,
|
||||
false, // IsTransactionSafe
|
||||
false, // IsNoexcept
|
||||
BOOST_CLBL_TRTS_CC_TAG, T, Return, Args...> {
|
||||
|
||||
using type = Return(BOOST_CLBL_TRTS_CC T::*)(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS;
|
||||
};
|
||||
|
||||
template<typename Return, typename T, typename... Args>
|
||||
struct set_member_function_qualifiers_t<
|
||||
flag_map<int BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>::value,
|
||||
false,
|
||||
true,
|
||||
BOOST_CLBL_TRTS_CC_TAG, T, Return, Args...> {
|
||||
|
||||
using type = Return(BOOST_CLBL_TRTS_CC T::*)(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER;
|
||||
};
|
||||
|
||||
template<typename Return, typename T, typename... Args>
|
||||
struct set_member_function_qualifiers_t<
|
||||
flag_map<int BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>::value,
|
||||
true,
|
||||
false,
|
||||
BOOST_CLBL_TRTS_CC_TAG, T, Return, Args...> {
|
||||
|
||||
using type = Return(BOOST_CLBL_TRTS_CC T::*)(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER;
|
||||
};
|
||||
|
||||
template<typename Return, typename T, typename... Args>
|
||||
struct set_member_function_qualifiers_t<
|
||||
flag_map<int BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>::value,
|
||||
true,
|
||||
true,
|
||||
BOOST_CLBL_TRTS_CC_TAG, T, Return, Args...> {
|
||||
|
||||
using type = Return(BOOST_CLBL_TRTS_CC T::*)(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER;
|
||||
};
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE std::false_type
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_3.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
#undef BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE
|
||||
|
||||
#ifdef BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE
|
||||
|
||||
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE std::true_type
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE transaction_safe
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_3.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
#undef BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
Copyright (c) 2016 Barrett Adair
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
HEADER GUARDS INTENTIONALLY OMITTED
|
||||
DO NOT INCLUDE THIS HEADER DIRECTLY
|
||||
*/
|
||||
|
||||
#define BOOST_CLBL_TRTS_NOEXCEPT_SPEC
|
||||
#define BOOST_CLBL_TRTS_IS_NOEXCEPT std::false_type
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_4.hpp>
|
||||
#undef BOOST_CLBL_TRTS_NOEXCEPT_SPEC
|
||||
#undef BOOST_CLBL_TRTS_IS_NOEXCEPT
|
||||
|
||||
#ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
|
||||
#define BOOST_CLBL_TRTS_NOEXCEPT_SPEC noexcept
|
||||
#define BOOST_CLBL_TRTS_IS_NOEXCEPT std::true_type
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_4.hpp>
|
||||
#undef BOOST_CLBL_TRTS_NOEXCEPT_SPEC
|
||||
#undef BOOST_CLBL_TRTS_IS_NOEXCEPT
|
||||
#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
|
||||
@@ -0,0 +1,147 @@
|
||||
/*
|
||||
Copyright (c) 2016 Barrett Adair
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
HEADER GUARDS INTENTIONALLY OMITTED
|
||||
DO NOT INCLUDE THIS HEADER DIRECTLY
|
||||
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS - the function-level qualifiers for the
|
||||
current inclusion (combinations of `const` `volatile` `&` `&&`, or nothing)
|
||||
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE - the transaction_safe specifier for
|
||||
the current include (`transaction_safe` or nothing)
|
||||
|
||||
BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE - `std::true_type` or `std::false_type`,
|
||||
tied on whether BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE is `transaction_safe`
|
||||
|
||||
BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER - `transaction_safe` when
|
||||
BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE is defined, otherwise nothing
|
||||
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC - the noexcept specifier for
|
||||
the current include (`noexcept` or nothing)
|
||||
|
||||
BOOST_CLBL_TRTS_IS_NOEXCEPT - `std::true_type` or `std::false_type`,
|
||||
tied on whether BOOST_CLBL_TRTS_NOEXCEPT_SPEC is `noexcept`
|
||||
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER - `noexcept` if
|
||||
BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES is defined, otherwise nothing
|
||||
*/
|
||||
|
||||
template<typename Return, typename T, typename... Args>
|
||||
struct pmf<Return(BOOST_CLBL_TRTS_CC T::*)(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC>
|
||||
: default_callable_traits<dummy BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS> {
|
||||
|
||||
static constexpr bool value = true;
|
||||
|
||||
using traits = pmf;
|
||||
|
||||
using return_type = Return;
|
||||
|
||||
using type = Return(BOOST_CLBL_TRTS_CC T::*)(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using invoke_type = typename std::conditional<
|
||||
std::is_rvalue_reference<T BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>::value,
|
||||
T BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS,
|
||||
typename std::add_lvalue_reference<T BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>::type
|
||||
>::type;
|
||||
|
||||
using arg_types = std::tuple<invoke_type, Args...>;
|
||||
using non_invoke_arg_types = std::tuple<Args...>;
|
||||
|
||||
using function_object_signature = Return(Args...);
|
||||
|
||||
using function_type = Return(invoke_type, Args...);
|
||||
|
||||
using qualified_function_type = Return(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using remove_varargs = type;
|
||||
|
||||
using add_varargs =
|
||||
Return(BOOST_CLBL_TRTS_VARARGS_CC T::*)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using is_noexcept = BOOST_CLBL_TRTS_IS_NOEXCEPT;
|
||||
|
||||
using remove_noexcept = Return(BOOST_CLBL_TRTS_CC T::*)(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE;
|
||||
|
||||
using add_noexcept = Return(BOOST_CLBL_TRTS_CC T::*)(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER;
|
||||
|
||||
using is_transaction_safe = BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE;
|
||||
|
||||
using remove_transaction_safe = Return(BOOST_CLBL_TRTS_CC T::*)(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using add_transaction_safe = Return(BOOST_CLBL_TRTS_CC T::*)(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using class_type = T;
|
||||
|
||||
using qualifiers = default_callable_traits<dummy BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>;
|
||||
|
||||
template<qualifier_flags Flags>
|
||||
using set_qualifiers = set_member_function_qualifiers<
|
||||
Flags, is_transaction_safe::value, is_noexcept::value,
|
||||
BOOST_CLBL_TRTS_CC_TAG, T, Return, Args...>;
|
||||
|
||||
using remove_member_reference = set_qualifiers<qualifiers::cv_flags>;
|
||||
|
||||
using add_member_lvalue_reference = set_qualifiers<
|
||||
collapse_flags<qualifiers::q_flags, lref_>::value>;
|
||||
|
||||
using add_member_rvalue_reference = set_qualifiers<
|
||||
collapse_flags<qualifiers::q_flags, rref_>::value>;
|
||||
|
||||
using add_member_const = set_qualifiers<qualifiers::q_flags | const_>;
|
||||
|
||||
using add_member_volatile = set_qualifiers<qualifiers::q_flags | volatile_>;
|
||||
|
||||
using add_member_cv = set_qualifiers<qualifiers::q_flags | cv_>;
|
||||
|
||||
using remove_member_const = set_qualifiers<
|
||||
qualifiers::ref_flags | remove_const_flag<qualifiers::cv_flags>::value>;
|
||||
|
||||
using remove_member_volatile = set_qualifiers<
|
||||
qualifiers::ref_flags | remove_volatile_flag<qualifiers::cv_flags>::value>;
|
||||
|
||||
using remove_member_cv = set_qualifiers<qualifiers::ref_flags>;
|
||||
|
||||
template<typename U>
|
||||
using apply_member_pointer =
|
||||
Return(BOOST_CLBL_TRTS_CC U::*)(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
template<typename NewReturn>
|
||||
using apply_return =
|
||||
NewReturn(BOOST_CLBL_TRTS_CC T::*)(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
template<template<class...> class Container>
|
||||
using expand_args = Container<invoke_type, Args...>;
|
||||
|
||||
using is_member_pointer = std::true_type;
|
||||
};
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
Copyright (c) 2016 Barrett Adair
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
HEADER GUARDS INTENTIONALLY OMITTED
|
||||
DO NOT INCLUDE THIS HEADER DIRECTLY
|
||||
|
||||
*/
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_varargs_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS const
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS \
|
||||
BOOST_CLBL_TRTS_ABOMINABLE_CONST
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_varargs_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS volatile
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS \
|
||||
BOOST_CLBL_TRTS_ABOMINABLE_VOLATILE
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_varargs_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS const volatile
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS \
|
||||
BOOST_CLBL_TRTS_ABOMINABLE_CONST BOOST_CLBL_TRTS_ABOMINABLE_VOLATILE
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_varargs_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#ifndef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS &
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS &
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_varargs_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS &&
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS &&
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_varargs_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS const &
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS const &
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_varargs_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS volatile &
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS volatile &
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_varargs_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS const volatile &
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS const volatile &
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_varargs_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS const &&
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS const &&
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_varargs_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS volatile &&
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS volatile &&
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_varargs_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS const volatile &&
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS const volatile &&
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_varargs_2.hpp>
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
|
||||
#endif // #ifndef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
Copyright (c) 2016 Barrett Adair
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
HEADER GUARDS INTENTIONALLY OMITTED
|
||||
DO NOT INCLUDE THIS HEADER DIRECTLY
|
||||
|
||||
*/
|
||||
|
||||
template<typename T, typename Return, typename... Args>
|
||||
struct set_varargs_member_function_qualifiers_t <
|
||||
flag_map<int BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>::value,
|
||||
false, // IsTransactionSafe
|
||||
false, // IsNoexcept
|
||||
BOOST_CLBL_TRTS_CC_TAG, T, Return, Args...> {
|
||||
|
||||
using type =
|
||||
Return(BOOST_CLBL_TRTS_VARARGS_CC T::*)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS;
|
||||
};
|
||||
|
||||
template<typename T, typename Return, typename... Args>
|
||||
struct set_varargs_member_function_qualifiers_t <
|
||||
flag_map<int BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>::value,
|
||||
false,
|
||||
true,
|
||||
BOOST_CLBL_TRTS_CC_TAG, T, Return, Args...> {
|
||||
|
||||
using type =
|
||||
Return(BOOST_CLBL_TRTS_VARARGS_CC T::*)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER;
|
||||
};
|
||||
|
||||
template<typename T, typename Return, typename... Args>
|
||||
struct set_varargs_member_function_qualifiers_t <
|
||||
flag_map<int BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>::value,
|
||||
true,
|
||||
false,
|
||||
BOOST_CLBL_TRTS_CC_TAG, T, Return, Args...> {
|
||||
|
||||
using type =
|
||||
Return(BOOST_CLBL_TRTS_VARARGS_CC T::*)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER;
|
||||
};
|
||||
|
||||
template<typename T, typename Return, typename... Args>
|
||||
struct set_varargs_member_function_qualifiers_t <
|
||||
flag_map<int BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>::value,
|
||||
true,
|
||||
true,
|
||||
BOOST_CLBL_TRTS_CC_TAG, T, Return, Args...> {
|
||||
|
||||
using type =
|
||||
Return(BOOST_CLBL_TRTS_VARARGS_CC T::*)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER;
|
||||
};
|
||||
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE std::false_type
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_varargs_3.hpp>
|
||||
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
#undef BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE
|
||||
|
||||
#ifdef BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE
|
||||
|
||||
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE std::true_type
|
||||
#define BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE transaction_safe
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_varargs_3.hpp>
|
||||
#endif
|
||||
|
||||
#undef BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
#undef BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
Copyright (c) 2016 Barrett Adair
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
HEADER GUARDS INTENTIONALLY OMITTED
|
||||
DO NOT INCLUDE THIS HEADER DIRECTLY
|
||||
*/
|
||||
|
||||
#define BOOST_CLBL_TRTS_NOEXCEPT_SPEC
|
||||
#define BOOST_CLBL_TRTS_IS_NOEXCEPT std::false_type
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_varargs_4.hpp>
|
||||
#undef BOOST_CLBL_TRTS_NOEXCEPT_SPEC
|
||||
#undef BOOST_CLBL_TRTS_IS_NOEXCEPT
|
||||
|
||||
#ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
|
||||
#define BOOST_CLBL_TRTS_NOEXCEPT_SPEC noexcept
|
||||
#define BOOST_CLBL_TRTS_IS_NOEXCEPT std::true_type
|
||||
#include <boost/callable_traits/detail/unguarded/pmf_varargs_4.hpp>
|
||||
#undef BOOST_CLBL_TRTS_NOEXCEPT_SPEC
|
||||
#undef BOOST_CLBL_TRTS_IS_NOEXCEPT
|
||||
#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
|
||||
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
Copyright (c) 2016 Barrett Adair
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
HEADER GUARDS INTENTIONALLY OMITTED
|
||||
DO NOT INCLUDE THIS HEADER DIRECTLY
|
||||
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS - the function-level qualifiers for the
|
||||
current inclusion (combinations of `const` `volatile` `&` `&&`, or nothing)
|
||||
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE - the transaction_safe specifier for
|
||||
the current include (`transaction_safe` or nothing)
|
||||
|
||||
BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE - `std::true_type` or `std::false_type`,
|
||||
tied on whether BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE is `transaction_safe`
|
||||
|
||||
BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER - `transaction_safe` when
|
||||
BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE is enabled, otherwise nothing
|
||||
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC - the noexcept specifier for
|
||||
the current include (`noexcept` or nothing)
|
||||
|
||||
BOOST_CLBL_TRTS_IS_NOEXCEPT - `std::true_type` or `std::false_type`,
|
||||
tied on whether BOOST_CLBL_TRTS_NOEXCEPT_SPEC is `noexcept`
|
||||
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER - `noexcept` if
|
||||
BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES is defined, otherwise nothing
|
||||
*/
|
||||
|
||||
template<typename Return, typename T, typename... Args>
|
||||
struct pmf<Return(BOOST_CLBL_TRTS_VARARGS_CC T::*)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC>
|
||||
: default_callable_traits<dummy BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS> {
|
||||
|
||||
static constexpr bool value = true;
|
||||
|
||||
using has_varargs = std::true_type;
|
||||
|
||||
using traits = pmf;
|
||||
|
||||
using return_type = Return;
|
||||
|
||||
using type = Return(BOOST_CLBL_TRTS_VARARGS_CC T::*)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using invoke_type = typename std::conditional<
|
||||
std::is_rvalue_reference<T BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>::value,
|
||||
T BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS,
|
||||
typename std::add_lvalue_reference<T BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>::type
|
||||
>::type;
|
||||
|
||||
using arg_types = std::tuple<invoke_type, Args...>;
|
||||
using non_invoke_arg_types = std::tuple<Args...>;
|
||||
|
||||
using function_object_signature = Return(Args..., ...);
|
||||
|
||||
using function_type = Return(invoke_type, Args..., ...);
|
||||
|
||||
using qualified_function_type = Return(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using remove_varargs =
|
||||
Return(BOOST_CLBL_TRTS_CC T::*)(Args...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using add_varargs = type;
|
||||
|
||||
using is_noexcept = BOOST_CLBL_TRTS_IS_NOEXCEPT;
|
||||
|
||||
using remove_noexcept = Return(BOOST_CLBL_TRTS_CC T::*)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE;
|
||||
|
||||
using add_noexcept = Return(BOOST_CLBL_TRTS_CC T::*)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER;
|
||||
|
||||
using is_transaction_safe = BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE;
|
||||
|
||||
using remove_transaction_safe = Return(BOOST_CLBL_TRTS_VARARGS_CC T::*)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using add_transaction_safe = Return(BOOST_CLBL_TRTS_VARARGS_CC T::*)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
using class_type = T;
|
||||
|
||||
using qualifiers = default_callable_traits<dummy BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>;
|
||||
|
||||
template<qualifier_flags Flags>
|
||||
using set_qualifiers = set_varargs_member_function_qualifiers<
|
||||
Flags, is_transaction_safe::value, is_noexcept::value,
|
||||
BOOST_CLBL_TRTS_CC_TAG, T, Return, Args...>;
|
||||
|
||||
using remove_member_reference = set_qualifiers<qualifiers::cv_flags>;
|
||||
|
||||
using add_member_lvalue_reference = set_qualifiers<
|
||||
collapse_flags<qualifiers::q_flags, lref_>::value>;
|
||||
|
||||
using add_member_rvalue_reference = set_qualifiers<
|
||||
collapse_flags<qualifiers::q_flags, rref_>::value>;
|
||||
|
||||
using add_member_const = set_qualifiers<qualifiers::q_flags | const_>;
|
||||
|
||||
using add_member_volatile = set_qualifiers<qualifiers::q_flags | volatile_>;
|
||||
|
||||
using add_member_cv = set_qualifiers<qualifiers::q_flags | cv_>;
|
||||
|
||||
using remove_member_const = set_qualifiers<
|
||||
qualifiers::ref_flags | remove_const_flag<qualifiers::cv_flags>::value>;
|
||||
|
||||
using remove_member_volatile = set_qualifiers<
|
||||
qualifiers::ref_flags | remove_volatile_flag<qualifiers::cv_flags>::value>;
|
||||
|
||||
using remove_member_cv = set_qualifiers<qualifiers::ref_flags>;
|
||||
|
||||
template<typename U>
|
||||
using apply_member_pointer =
|
||||
Return(BOOST_CLBL_TRTS_VARARGS_CC U::*)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
template<typename NewReturn>
|
||||
using apply_return =
|
||||
NewReturn(BOOST_CLBL_TRTS_VARARGS_CC T::*)(Args..., ...)
|
||||
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
|
||||
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
|
||||
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
|
||||
|
||||
template<template<class...> class Container>
|
||||
using expand_args = Container<invoke_type, Args...>;
|
||||
|
||||
using is_member_pointer = std::true_type;
|
||||
};
|
||||
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
|
||||
@Copyright Barrett Adair 2015-2017
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BOOST_CLBL_TRTS_DETAIL_UTILITY_HPP
|
||||
#define BOOST_CLBL_TRTS_DETAIL_UTILITY_HPP
|
||||
|
||||
#include <boost/callable_traits/detail/config.hpp>
|
||||
#include <boost/callable_traits/detail/sfinae_errors.hpp>
|
||||
#include <boost/callable_traits/detail/qualifier_flags.hpp>
|
||||
|
||||
namespace boost { namespace callable_traits { namespace detail {
|
||||
|
||||
struct cdecl_tag{};
|
||||
struct stdcall_tag{};
|
||||
struct fastcall_tag{};
|
||||
struct pascal_tag{};
|
||||
|
||||
struct invalid_type { invalid_type() = delete; };
|
||||
struct reference_error { reference_error() = delete; };
|
||||
|
||||
template<typename T>
|
||||
using error_type = typename std::conditional<
|
||||
std::is_reference<T>::value, reference_error, invalid_type>::type;
|
||||
|
||||
#ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
|
||||
struct abominable_functions_not_supported_on_this_compiler{};
|
||||
#endif
|
||||
|
||||
// used to convey "this type doesn't matter" in code
|
||||
struct dummy {};
|
||||
|
||||
// used as return type in failed SFINAE tests
|
||||
struct substitution_failure : std::false_type{};
|
||||
|
||||
template<bool Value>
|
||||
using bool_type = std::integral_constant<bool, Value>;
|
||||
|
||||
// shorthand for std::tuple_element
|
||||
template<std::size_t I, typename Tup>
|
||||
using at = typename std::tuple_element<I, Tup>::type;
|
||||
|
||||
template<typename T, typename Class>
|
||||
using add_member_pointer = T Class::*;
|
||||
|
||||
template<typename L, typename R, typename ErrorType>
|
||||
using fail_when_same = fail_if<std::is_same<L, R>::value, ErrorType>;
|
||||
|
||||
template<typename T, typename ErrorType,
|
||||
typename U = typename std::remove_reference<T>::type>
|
||||
using try_but_fail_if_invalid = sfinae_try<T,
|
||||
fail_when_same<U, invalid_type, ErrorType>,
|
||||
fail_when_same<U, reference_error,
|
||||
reference_type_not_supported_by_this_metafunction>>;
|
||||
|
||||
template<typename T, typename ErrorType,
|
||||
typename U = typename std::remove_reference<T>::type,
|
||||
bool is_reference_error = std::is_same<reference_error, U>::value>
|
||||
using fail_if_invalid = fail_if<
|
||||
std::is_same<U, invalid_type>::value || is_reference_error,
|
||||
typename std::conditional<is_reference_error,
|
||||
reference_type_not_supported_by_this_metafunction, ErrorType>::type>;
|
||||
|
||||
template<typename T, typename Fallback>
|
||||
using fallback_if_invalid = typename std::conditional<
|
||||
std::is_same<T, invalid_type>::value, Fallback, T>::type;
|
||||
|
||||
template<typename T, template<class> class Alias, typename U = Alias<T>>
|
||||
struct force_sfinae {
|
||||
using type = U;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
using shallow_decay = typename std::remove_cv<
|
||||
typename std::remove_reference<T>::type>::type;
|
||||
|
||||
template<typename T>
|
||||
struct is_reference_wrapper_t {
|
||||
using type = std::false_type;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct is_reference_wrapper_t<std::reference_wrapper<T>> {
|
||||
using type = std::true_type;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
using is_reference_wrapper =
|
||||
typename is_reference_wrapper_t<shallow_decay<T>>::type;
|
||||
|
||||
template<typename T, typename = std::true_type>
|
||||
struct unwrap_reference_t {
|
||||
using type = T;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct unwrap_reference_t<T, is_reference_wrapper<T>> {
|
||||
using type = decltype(std::declval<T>().get());
|
||||
};
|
||||
|
||||
// removes std::reference_wrapper
|
||||
template<typename T>
|
||||
using unwrap_reference = typename unwrap_reference_t<T>::type;
|
||||
|
||||
}}} // namespace boost::callable_traits::detail
|
||||
|
||||
#endif // #ifndef BOOST_CLBL_TRTS_DETAIL_UTILITY_HPP
|
||||
Reference in New Issue
Block a user