|
||||
File indexing completed on 2025-01-30 09:34:24
0001 /* 0002 * 0003 @Copyright Barrett Adair 2015-2017 0004 0005 Distributed under the Boost Software License, Version 1.0. 0006 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) 0007 0008 */ 0009 0010 #ifndef BOOST_CLBL_TRTS_IS_VOLATILE_MEMBER_HPP 0011 #define BOOST_CLBL_TRTS_IS_VOLATILE_MEMBER_HPP 0012 0013 #include <boost/callable_traits/detail/core.hpp> 0014 0015 namespace boost { namespace callable_traits { 0016 0017 //[ is_volatile_member_hpp 0018 /*`[section:ref_is_volatile_member is_volatile_member] 0019 [heading Header] 0020 ``#include <boost/callable_traits/is_volatile_member.hpp>`` 0021 [heading Definition] 0022 */ 0023 0024 0025 // inherits from either std::true_type or std::false_type 0026 template<typename T> 0027 struct is_volatile_member; 0028 0029 //<- 0030 template<typename T> 0031 struct is_volatile_member : detail::traits< 0032 detail::shallow_decay<T>>::is_volatile_member { 0033 0034 using type = typename detail::traits< 0035 detail::shallow_decay<T>>::is_volatile_member; 0036 }; 0037 0038 #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES 0039 0040 template<typename T> 0041 struct is_volatile_member_v { 0042 static_assert(std::is_same<T, detail::dummy>::value, 0043 "Variable templates not supported on this compiler."); 0044 }; 0045 0046 #else 0047 //-> 0048 // only available when variable templates are supported 0049 template<typename T> 0050 //<- 0051 BOOST_CLBL_TRAITS_INLINE_VAR 0052 //-> 0053 constexpr bool is_volatile_member_v = //see below 0054 //<- 0055 detail::traits<detail::shallow_decay<T>>::is_volatile_member::value; 0056 0057 #endif 0058 0059 }} // namespace boost::callable_traits 0060 //-> 0061 0062 0063 /*` 0064 [heading Constraints] 0065 * none 0066 0067 [heading Behavior] 0068 * `is_volatile_member<T>::value` is `true` when either: 0069 * `T` is a function type with a `volatile` member qualifier 0070 * `T` is a pointer to a member function with a `volatile` member qualifier 0071 * `T` is a function object with a non-overloaded `operator()`, where the `operator()` has a `volatile` member qualifier 0072 * On compilers that support variable templates, `is_volatile_member_v<T>` is equivalent to `is_volatile_member<T>::value`. 0073 0074 [heading Input/Output Examples] 0075 [table 0076 [[`T`] [`is_volatile_member_v<T>`]] 0077 [[`int() volatile`] [`true`]] 0078 [[`int() const volatile`] [`true`]] 0079 [[`int() volatile &&`] [`true`]] 0080 [[`int(foo::*)() volatile`] [`true`]] 0081 [[`int(foo::* const)() volatile`] [`true`]] 0082 [[`int(foo::*)() const volatile`] [`true`]] 0083 [[`int(foo::*)() const volatile &&`][`true`]] 0084 [[`int()`] [`false`]] 0085 [[`int() const`] [`false`]] 0086 [[`int() &&`] [`false`]] 0087 [[`int(*)()`] [`false`]] 0088 [[`int`] [`false`]] 0089 [[`int foo::*`] [`false`]] 0090 [[`volatile int foo::*`] [`false`]] 0091 ] 0092 0093 [heading Example Program] 0094 [import ../example/is_volatile_member.cpp] 0095 [is_volatile_member] 0096 [endsect] 0097 */ 0098 //] 0099 0100 #endif // #ifndef BOOST_CLBL_TRTS_IS_VOLATILE_MEMBER_HPP
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |