3 @Copyright Barrett Adair 2015-2017
4 Distributed under the Boost Software License, Version 1.0.
5 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
9 #ifndef BOOST_CLBL_TRTS_IS_CV_MEMBER_HPP
10 #define BOOST_CLBL_TRTS_IS_CV_MEMBER_HPP
12 #include <boost/callable_traits/detail/core.hpp>
14 namespace boost { namespace callable_traits {
17 /*`[section:ref_is_cv_member is_cv_member]
19 ``#include <boost/callable_traits/is_cv_member.hpp>``
23 // inherits from either std::true_type or std::false_type
30 : detail::traits<detail::shallow_decay<T>>::is_cv_member {
31 using type = typename detail::traits<
32 detail::shallow_decay<T>>::is_cv_member;
35 #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES
38 struct is_cv_member_v {
39 static_assert(std::is_same<T, detail::dummy>::value,
40 "Variable templates not supported on this compiler.");
45 // only available when variable templates are supported
48 BOOST_CLBL_TRAITS_INLINE_VAR
50 constexpr bool is_cv_member_v = //see below
52 detail::traits<detail::shallow_decay<T>>::is_cv_member::value;
56 }} // namespace boost::callable_traits
64 * `is_cv_member<T>::value` is `true` when either:
65 * `T` is a function type with both `const` and `volatile` member qualifiers
66 * `T` is a pointer to a member function with both `const` and `volatile` member qualifiers
67 * `T` is a function object with a non-overloaded `operator()`, where the `operator()` has both `const` and `volatile` member qualifiers
68 * On compilers that support variable templates, `is_cv_member_v<T>` is equivalent to `is_cv_member<T>::value`.
70 [heading Input/Output Examples]
72 [[`T`] [`is_cv_member_v<T>`]]
73 [[`int() const volatile`] [`true`]]
74 [[`int() const volatile &`] [`true`]]
75 [[`int(foo::* const &)() const volatile`] [`true`]]
76 [[`int() const`] [`false`]]
77 [[`int() volatile`] [`false`]]
78 [[`int(foo::*)() const`] [`false`]]
79 [[`int() const`] [`false`]]
80 [[`int() volatile`] [`false`]]
81 [[`int() &&`] [`false`]]
82 [[`int(*)()`] [`false`]]
84 [[`int foo::*`] [`false`]]
85 [[`const int foo::*`] [`false`]]
88 [heading Example Program]
89 [import ../example/is_cv_member.cpp]
95 #endif // #ifndef BOOST_CLBL_TRTS_IS_CV_MEMBER_HPP