3 @Copyright Barrett Adair 2015-2017
5 Distributed under the Boost Software License, Version 1.0.
6 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
10 #ifndef BOOST_CLBL_TRTS_IS_VOLATILE_MEMBER_HPP
11 #define BOOST_CLBL_TRTS_IS_VOLATILE_MEMBER_HPP
13 #include <boost/callable_traits/detail/core.hpp>
15 namespace boost { namespace callable_traits {
17 //[ is_volatile_member_hpp
18 /*`[section:ref_is_volatile_member is_volatile_member]
20 ``#include <boost/callable_traits/is_volatile_member.hpp>``
25 // inherits from either std::true_type or std::false_type
27 struct is_volatile_member;
31 struct is_volatile_member : detail::traits<
32 detail::shallow_decay<T>>::is_volatile_member {
34 using type = typename detail::traits<
35 detail::shallow_decay<T>>::is_volatile_member;
38 #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES
41 struct is_volatile_member_v {
42 static_assert(std::is_same<T, detail::dummy>::value,
43 "Variable templates not supported on this compiler.");
48 // only available when variable templates are supported
51 BOOST_CLBL_TRAITS_INLINE_VAR
53 constexpr bool is_volatile_member_v = //see below
55 detail::traits<detail::shallow_decay<T>>::is_volatile_member::value;
59 }} // namespace boost::callable_traits
68 * `is_volatile_member<T>::value` is `true` when either:
69 * `T` is a function type with a `volatile` member qualifier
70 * `T` is a pointer to a member function with a `volatile` member qualifier
71 * `T` is a function object with a non-overloaded `operator()`, where the `operator()` has a `volatile` member qualifier
72 * On compilers that support variable templates, `is_volatile_member_v<T>` is equivalent to `is_volatile_member<T>::value`.
74 [heading Input/Output Examples]
76 [[`T`] [`is_volatile_member_v<T>`]]
77 [[`int() volatile`] [`true`]]
78 [[`int() const volatile`] [`true`]]
79 [[`int() volatile &&`] [`true`]]
80 [[`int(foo::*)() volatile`] [`true`]]
81 [[`int(foo::* const)() volatile`] [`true`]]
82 [[`int(foo::*)() const volatile`] [`true`]]
83 [[`int(foo::*)() const volatile &&`][`true`]]
85 [[`int() const`] [`false`]]
86 [[`int() &&`] [`false`]]
87 [[`int(*)()`] [`false`]]
89 [[`int foo::*`] [`false`]]
90 [[`volatile int foo::*`] [`false`]]
93 [heading Example Program]
94 [import ../example/is_volatile_member.cpp]
100 #endif // #ifndef BOOST_CLBL_TRTS_IS_VOLATILE_MEMBER_HPP