![]() |
Home | Libraries | People | FAQ | More |
#include <boost/callable_traits/add_member_const.hpp>
template<typename T> using add_member_const_t = //see below template<typename T> struct add_member_const { using type = add_member_const_t<T>; };
T must be a function
type or a member function pointer type
const qualifier
to T, if not already
present.
A substitution failure occurs on GCC builds older than version 4.9.2 with function types, because those versions did not support abominable function types. Full support on GCC 4.9.2+, Clang 3.5+, Visual Studio 2015, and XCode 6.4+.
|
|
|
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
#include <type_traits> #include <boost/callable_traits/add_member_const.hpp> namespace ct = boost::callable_traits; struct foo {}; int main() { { using pmf = int(foo::*)(); using expect = int(foo::*)() const; using test = ct::add_member_const_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { // add_member_const_t doesn't change anything when // the function type is already const. using pmf = int(foo::*)() const &&; using expect = int(foo::*)() const &&; using test = ct::add_member_const_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { using pmf = int(foo::*)() volatile &; using expect = int(foo::*)() const volatile &; using test = ct::add_member_const_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { // add_member_const_t can also be used with "abominable" // function types. using f = int(); using expect = int() const; using test = ct::add_member_const_t<f>; static_assert(std::is_same<test, expect>::value, ""); } }
#include <boost/callable_traits/remove_member_const.hpp>
template<typename T> using remove_member_const_t = //see below template<typename T> struct remove_member_const { using type = remove_member_const_t<T>; };
T must be a function
type or a member function pointer type
const
qualifier from T, if
present.
Full support on GCC 4.7.4+, Clang 3.5+, Visual Studio 2015, and XCode 6.4+.
|
|
|
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
#include <type_traits> #include <boost/callable_traits/remove_member_const.hpp> namespace ct = boost::callable_traits; struct foo {}; int main() { { using pmf = int(foo::*)() const; using expect = int(foo::*)(); using test = ct::remove_member_const_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { using pmf = int(foo::*)() const &&; using expect = int(foo::*)() &&; using test = ct::remove_member_const_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { using pmf = int(foo::*)() const volatile &; using expect = int(foo::*)() volatile &; using test = ct::remove_member_const_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { using f = int() const; using expect = int(); using test = ct::remove_member_const_t<f>; static_assert(std::is_same<test, expect>::value, ""); } }
#include <boost/callable_traits/add_member_volatile.hpp>
template<typename T> using add_member_volatile_t = //see below template<typename T> struct add_member_volatile { using type = add_member_volatile_t<T>; };
T must be a function
type or a member function pointer type
T,
if not already present.
A substitution failure occurs on GCC builds older than version 4.9.2 with function types, because those versions did not support abominable function types. Full support on GCC 4.9.2+, Clang 3.5+, Visual Studio 2015, and XCode 6.4+.
|
|
|
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
#include <type_traits> #include <boost/callable_traits/add_member_volatile.hpp> namespace ct = boost::callable_traits; struct foo {}; int main() { { using pmf = void(foo::*)(); using expect = void(foo::*)() volatile; using test = ct::add_member_volatile_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { // add_member_volatile_t doesn't change anything when // the function type is already volatile. using pmf = void(foo::*)() volatile &&; using expect = void(foo::*)() volatile &&; using test = ct::add_member_volatile_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { using pmf = void(foo::*)() const &; using expect = void(foo::*)() const volatile &; using test = ct::add_member_volatile_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { // add_member_volatile_t can also be used with "abominable" // function types. using f = void(); using expect = void() volatile; using test = ct::add_member_volatile_t<f>; static_assert(std::is_same<test, expect>::value, ""); } }
#include <boost/callable_traits/remove_member_volatile.hpp>
template<typename T> using remove_member_volatile_t = //see below template<typename T> struct remove_member_volatile { using type = remove_member_volatile_t<T>; };
T must be a function
type or a member function pointer type
volatile
qualifier from T, if
present.
Full support on GCC 4.7.4+, Clang 3.5+, Visual Studio 2015, and XCode 6.4+.
|
|
|
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
#include <type_traits> #include <boost/callable_traits/remove_member_volatile.hpp> namespace ct = boost::callable_traits; struct foo {}; int main() { { using pmf = int(foo::*)() const volatile; using expect = int(foo::*)() const; using test = ct::remove_member_volatile_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { using pmf = int(foo::*)() volatile &&; using expect = int(foo::*)() &&; using test = ct::remove_member_volatile_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { using pmf = int(foo::*)() volatile &; using expect = int(foo::*)() &; using test = ct::remove_member_volatile_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { using f = int() const volatile; using expect = int() const; using test = ct::remove_member_volatile_t<f>; static_assert(std::is_same<test, expect>::value, ""); } }
#include <boost/callable_traits/add_member_cv.hpp>
template<typename T> using add_member_cv_t = //see below template<typename T> struct add_member_cv { using type = add_member_cv_t<T>; };
T must be a function
type or a member function pointer type
const and volatile qualifiers to T,
if not already present.
A substitution failure occurs on GCC builds older than version 4.9.2 with function types, because those versions did not support abominable function types. Full support on GCC 4.9.2+, Clang 3.5+, Visual Studio 2015, and XCode 6.4+.
|
|
|
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
#include <type_traits> #include <boost/callable_traits/add_member_cv.hpp> namespace ct = boost::callable_traits; struct foo {}; int main() { { using pmf = void(foo::*)(); using expect = void(foo::*)() const volatile; using test = ct::add_member_cv_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { // add_member_cv_t doesn't change anything when // the function type is already cv-qualified. using pmf = void(foo::*)() const volatile &&; using expect = void(foo::*)() const volatile &&; using test = ct::add_member_cv_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { using pmf = void(foo::*)() volatile &; using expect = void(foo::*)() const volatile &; using test = ct::add_member_cv_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { // add_member_cv_t can also be used with "abominable" // function types. using f = void(); using expect = void() const volatile; using test = ct::add_member_cv_t<f>; static_assert(std::is_same<test, expect>::value, ""); } }
#include <boost/callable_traits/remove_member_cv.hpp>
template<typename T> using remove_member_cv_t = //see below template<typename T> struct remove_member_cv { using type = remove_member_cv_t<T>; };
T must be a function
type or a member function pointer type
const and/or
volatile qualifiers from
T, if present.
Full support on GCC 4.7.4+, Clang 3.5+, Visual Studio 2015, and XCode 6.4+.
|
|
|
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
#include <type_traits> #include <boost/callable_traits/remove_member_cv.hpp> namespace ct = boost::callable_traits; struct foo {}; int main() { { using pmf = int(foo::*)() const volatile; using expect = int(foo::*)(); using test = ct::remove_member_cv_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { using pmf = int(foo::*)() const &&; using expect = int(foo::*)() &&; using test = ct::remove_member_cv_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { using pmf = int(foo::*)() const volatile &; using expect = int(foo::*)() &; using test = ct::remove_member_cv_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { using f = int() const volatile; using expect = int(); using test = ct::remove_member_cv_t<f>; static_assert(std::is_same<test, expect>::value, ""); } }
#include <boost/callable_traits/add_member_lvalue_reference.hpp>
#ifdef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS template<typename T> struct add_member_lvalue_reference_t { static_assert(std::is_same<T, detail::dummy>::value, "Reference member qualifiers are not supported by this configuration."); }; #else template<typename T> using add_member_lvalue_reference_t = //see below #endif // #ifdef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS template<typename T> struct add_member_lvalue_reference { using type = add_member_lvalue_reference_t<T>; };
T must be a function
type or a member function pointer type
&)
to T, if not already
present.
A static_assert always fails
on GCC builds older than version 4.9.2, because those versions did not support
reference member qualifiers. Full support on GCC 4.9.2+, Clang 3.5+, Visual
Studio 2015, and XCode 6.4+.
|
|
|
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
#include <type_traits> #include <boost/callable_traits/add_member_lvalue_reference.hpp> namespace ct = boost::callable_traits; struct foo {}; int main() { { using pmf = void(foo::*)(); using expect = void(foo::*)() &; using test = ct::add_member_lvalue_reference_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { // add_member_lvalue_reference_t doesn't change anything when // the function type already has an lvalue qualifier. using pmf = void(foo::*)() &; using expect = void(foo::*)() &; using test = ct::add_member_lvalue_reference_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { // add_member_lvalue_reference_t models C++11 reference collapsing // rules, so that adding an lvalue qualifier to an // rvalue-qualified type will force the lvalue. using pmf = void(foo::*)() &&; using expect = void(foo::*)() &; using test = ct::add_member_lvalue_reference_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { // add_member_lvalue_reference_t can also be used to create "abominable" // function types. using f = void(); using expect = void() &; using test = ct::add_member_lvalue_reference_t<f>; static_assert(std::is_same<test, expect>::value, ""); } }
#include <boost/callable_traits/add_member_rvalue_reference.hpp>
#ifdef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS template<typename T> struct add_member_rvalue_reference_t { static_assert(std::is_same<T, detail::dummy>::value, "Reference member qualifiers are not supported by this configuration."); }; #else template<typename T> using add_member_rvalue_reference_t = //see below #endif // #ifdef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS template<typename T> struct add_member_rvalue_reference { using type = add_member_rvalue_reference_t<T>; };
T must be a function
type or a member function pointer type
&&)
to T, if not already
present.
A static_assert always fails
on GCC builds older than version 4.9.2, because those versions did not support
reference member qualifiers. Full support on GCC 4.9.2+, Clang 3.5+, Visual
Studio 2015, and XCode 6.4+.
|
|
|
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
#include <type_traits> #include <boost/callable_traits/add_member_rvalue_reference.hpp> namespace ct = boost::callable_traits; struct foo {}; int main() { { using pmf = void(foo::*)(); using expect = void(foo::*)() &&; using test = ct::add_member_rvalue_reference_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { // add_member_rvalue_reference_t doesn't change anything when // the function type already has an rvalue qualifier. using pmf = void(foo::*)() &&; using expect = void(foo::*)() &&; using test = ct::add_member_rvalue_reference_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { // add_member_rvalue_reference_t models C++11 reference collapsing // rules, so that adding an rvalue qualifier to an // lvalue-qualified type will not change anything. using pmf = void(foo::*)() const &; using expect = void(foo::*)() const &; using test = ct::add_member_rvalue_reference_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { // add_member_rvalue_reference_t can also be used with "abominable" // function types. using f = void() const; using expect = void() const &&; using test = ct::add_member_rvalue_reference_t<f>; static_assert(std::is_same<test, expect>::value, ""); } }
#include <boost/callable_traits/remove_member_reference.hpp>
template<typename T> using remove_member_reference_t = //see below template<typename T> struct remove_member_reference { using type = remove_member_reference_t<T>; };
T must be a function
type or a member function pointer type
& or
&& qualifiers from
T, if present.
Full support on GCC 4.7.4+, Clang 3.5+, Visual Studio 2015, and XCode 6.4+.
|
|
|
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
|
|
(substitution failure) |
#include <type_traits> #include <boost/callable_traits/remove_member_reference.hpp> namespace ct = boost::callable_traits; struct foo {}; int main() { { using pmf = int(foo::*)() &; using expect = int(foo::*)(); using test = ct::remove_member_reference_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { using pmf = int(foo::*)() const &&; using expect = int(foo::*)() const; using test = ct::remove_member_reference_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { using pmf = int(foo::*)() const volatile &; using expect = int(foo::*)() const volatile; using test = ct::remove_member_reference_t<pmf>; static_assert(std::is_same<test, expect>::value, ""); } { using f = int() &&; using expect = int(); using test = ct::remove_member_reference_t<f>; static_assert(std::is_same<test, expect>::value, ""); } }
#include <boost/callable_traits/has_member_qualifiers.hpp>
template<typename T> struct has_member_qualifiers; //immplementation-defined template<typename T> constexpr bool has_member_qualifiers_v = //see below
std::false_type is inherited by has_member_qualifiers<T>
and is aliased by typename has_member_qualifiers<T>::type, except when one of the following
criteria is met, in which case std::true_type
would be similarly inherited and aliased:
T is a function
with member qualifiers
T is a member function
pointer with member qualifiers
T is a function
object with a member-qualified operator()
has_member_qualifiers_v<T> is equivalent to has_member_qualifiers<T>::value.
Full support on GCC 4.7.4+, Clang 3.5+, Visual Studio 2015, and XCode 6.4+.
|
|
|
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <type_traits> #include <boost/callable_traits/has_member_qualifiers.hpp> namespace ct = boost::callable_traits; struct foo; static_assert(ct::has_member_qualifiers<int(foo::*)() const>::value, ""); static_assert(ct::has_member_qualifiers<int(foo::*)() volatile>::value, ""); static_assert(!ct::has_member_qualifiers<int(foo::*)()>::value, ""); int main() {}
#include <boost/callable_traits/is_const_member.hpp>
template<typename T> struct is_const_member; //see below #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES template<typename T> struct is_const_member_v { static_assert(std::is_same<T, detail::dummy>::value, "Variable templates not supported on this compiler."); }; #else template<typename T> constexpr bool is_const_member_v = //see below #endif
std::false_type is inherited by is_const_member<T>
and is aliased by typename is_const_member<T>::type, except when one of the following
criteria is met, in which case std::true_type
would be similarly inherited and aliased:
T is a function
type with a const
member qualifier
T is a pointer
to a member function with a const
member qualifier
T is a function
object with a non-overloaded operator(), where the operator() has a const
member qualifier
is_const_member_v<T> is equivalent to is_const_member<T>::value.
Full support on GCC 4.7.4+, Clang 3.5+, Visual Studio 2015, and XCode 6.4+.
|
|
|
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <type_traits> #include <boost/callable_traits/is_const_member.hpp> namespace ct = boost::callable_traits; struct foo; static_assert(ct::is_const_member<int(foo::*)() const>::value, ""); static_assert(!ct::is_const_member<int(foo::*)()>::value, ""); int main() {}
#include <boost/callable_traits/is_volatile_member.hpp>
template<typename T> struct is_volatile_member; //see below #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES template<typename T> struct is_volatile_member_v { static_assert(std::is_same<T, detail::dummy>::value, "Variable templates not supported on this compiler."); }; #else template<typename T> constexpr bool is_volatile_member_v = //see below #endif
std::false_type is inherited by is_volatile_member<T>
and is aliased by typename is_volatile_member<T>::type, except when one of the following
criteria is met, in which case std::true_type
would be similarly inherited and aliased:
T is a function
type with a volatile
member qualifier
T is a pointer
to a member function with a volatile
member qualifier
T is a function
object with a non-overloaded operator(), where the operator() has a volatile
member qualifier
is_volatile_member_v<T> is equivalent to is_volatile_member<T>::value.
Full support on GCC 4.7.4+, Clang 3.5+, Visual Studio 2015, and XCode 6.4+.
|
|
|
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <type_traits> #include <boost/callable_traits/is_volatile_member.hpp> namespace ct = boost::callable_traits; static_assert(ct::is_volatile_member<int() volatile>::value, ""); static_assert(ct::is_volatile_member<int() const volatile>::value, ""); static_assert(!ct::is_volatile_member<int()>::value, ""); struct foo; static_assert(ct::is_volatile_member<int(foo::*)() volatile>::value, ""); static_assert(!ct::is_volatile_member<int(foo::*)() const>::value, ""); static_assert(!ct::is_volatile_member<int(foo::*)()>::value, ""); int main() {}
#include <boost/callable_traits/is_cv_member.hpp>
template<typename T> struct is_cv_member; //see below #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES template<typename T> struct is_cv_member_v { static_assert(std::is_same<T, detail::dummy>::value, "Variable templates not supported on this compiler."); }; #else template<typename T> constexpr bool is_cv_member_v = //see below #endif
std::false_type is inherited by is_cv_member<T>
and is aliased by typename is_cv_member<T>::type, except when one of the following
criteria is met, in which case std::true_type
would be similarly inherited and aliased:
T is a function
type with both const
and volatile member
qualifiers
T is a pointer
to a member function with both const
and volatile member
qualifiers
T is a function
object with a non-overloaded operator(), where the operator() has both const
and volatile member
qualifiers
is_cv_member_v<T> is equivalent to is_cv_member<T>::value.
Full support on GCC 4.7.4+, Clang 3.5+, Visual Studio 2015, and XCode 6.4+.
|
|
|
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <type_traits> #include <boost/callable_traits/is_cv_member.hpp> namespace ct = boost::callable_traits; struct foo; static_assert(ct::is_cv_member<int(foo::*)() const volatile>::value, ""); static_assert(!ct::is_cv_member<int(foo::*)()>::value, ""); static_assert(!ct::is_cv_member<int(foo::*)() const>::value, ""); static_assert(!ct::is_cv_member<int(foo::*)() volatile>::value, ""); int main() {}
#include <boost/callable_traits/is_lvalue_reference_member.hpp>
template<typename T> struct is_lvalue_reference_member; //see below #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES template<typename T> struct is_lvalue_reference_member_v { static_assert(std::is_same<T, detail::dummy>::value, "Variable templates not supported on this compiler."); }; #else template<typename T> constexpr bool is_lvalue_reference_member_v = //see below #endif
std::false_type is inherited by is_lvalue_reference_member<T>
and is aliased by typename is_lvalue_reference_member<T>::type, except when one of the following
criteria is met, in which case std::true_type
would be similarly inherited and aliased:
T is a function
type with a '&' member qualifier
T is a pointer
to a member function with a '&' member qualifiers
T is a function
object with a non-overloaded operator(), where the operator() has a '&' member qualifier
is_lvalue_reference_member_v<T> is equivalent to is_lvalue_reference_member<T>::value.
Full support on GCC 4.9.2+, Clang 3.5+, Visual Studio 2015, and XCode 6.4+.
|
|
|
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <type_traits> #include <boost/callable_traits/is_lvalue_reference_member.hpp> namespace ct = boost::callable_traits; static_assert(ct::is_lvalue_reference_member<int()&>::value, ""); static_assert(!ct::is_lvalue_reference_member<int()&&>::value, ""); static_assert(!ct::is_lvalue_reference_member<int()>::value, ""); struct foo; static_assert(ct::is_lvalue_reference_member<int(foo::*)()&>::value, ""); static_assert(!ct::is_lvalue_reference_member<int(foo::*)()&&>::value, ""); static_assert(!ct::is_lvalue_reference_member<int(foo::*)()>::value, ""); int main() {}
#include <boost/callable_traits/is_rvalue_reference_member.hpp>
template<typename T> struct is_rvalue_reference_member; //see below #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES template<typename T> struct is_rvalue_reference_member_v { static_assert(std::is_same<T, detail::dummy>::value, "Variable templates not supported on this compiler."); }; #else template<typename T> constexpr bool is_rvalue_reference_member_v = //see below #endif
std::false_type is inherited by is_rvalue_reference_member<T>
and is aliased by typename is_rvalue_reference_member<T>::type, except when one of the following
criteria is met, in which case std::true_type
would be similarly inherited and aliased:
T is a function
type with a '&&' member qualifier
T is a pointer
to a member function with a '&&' member qualifiers
T is a function
object with a non-overloaded operator(), where the operator() has a '&&' member qualifier
is_rvalue_reference_member_v<T> is equivalent to is_rvalue_reference_member<T>::value.
Full support on GCC 4.9.2+, Clang 3.5+, Visual Studio 2015, and XCode 6.4+.
|
|
|
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <type_traits> #include <boost/callable_traits/is_rvalue_reference_member.hpp> namespace ct = boost::callable_traits; static_assert(ct::is_rvalue_reference_member<int()&&>::value, ""); static_assert(!ct::is_rvalue_reference_member<int()&>::value, ""); static_assert(!ct::is_rvalue_reference_member<int()>::value, ""); struct foo; static_assert(ct::is_rvalue_reference_member<int(foo::*)()&&>::value, ""); static_assert(!ct::is_rvalue_reference_member<int(foo::*)()&>::value, ""); static_assert(!ct::is_rvalue_reference_member<int(foo::*)()>::value, ""); int main() {}
#include <boost/callable_traits/is_reference_member.hpp>
template<typename T> struct is_reference_member; //see below #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES template<typename T> struct is_reference_member_v { static_assert(std::is_same<T, detail::dummy>::value, "Variable templates not supported on this compiler."); }; #else template<typename T> constexpr bool is_reference_member_v = //see below #endif
std::false_type is inherited by is_reference_member<T>
and is aliased by typename is_reference_member<T>::type, except when one of the following
criteria is met, in which case std::true_type
would be similarly inherited and aliased:
T is a function
type with a '&' or '&&' member qualifier
T is a pointer
to a member function with a '&' or '&&' member qualifiers
T is a function
object with a non-overloaded operator(), where the operator() has a '&' or '&&'
member qualifier
is_reference_member_v<T> is equivalent to is_reference_member<T>::value.
Full support on GCC 4.9.2+, Clang 3.5+, Visual Studio 2015, and XCode 6.4+.
|
|
|
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <type_traits> #include <boost/callable_traits/is_reference_member.hpp> namespace ct = boost::callable_traits; static_assert(ct::is_reference_member<int()&>::value, ""); static_assert(ct::is_reference_member<int()&&>::value, ""); static_assert(!ct::is_reference_member<int()>::value, ""); struct foo; static_assert(ct::is_reference_member<int(foo::*)()&>::value, ""); static_assert(ct::is_reference_member<int(foo::*)()&&>::value, ""); static_assert(!ct::is_reference_member<int(foo::*)()>::value, ""); int main() {}