|
||||
File indexing completed on 2025-01-18 09:29:45
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_REFERENCE_MEMBER_HPP 0011 #define BOOST_CLBL_TRTS_IS_REFERENCE_MEMBER_HPP 0012 0013 #include <boost/callable_traits/detail/core.hpp> 0014 0015 namespace boost { namespace callable_traits { 0016 0017 //[ is_reference_member_hpp 0018 /*`[section:ref_is_reference_member is_reference_member] 0019 [heading Header] 0020 ``#include <boost/callable_traits/is_reference_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_reference_member; 0028 0029 //<- 0030 template<typename T> 0031 struct is_reference_member : detail::traits< 0032 detail::shallow_decay<T>>::is_reference_member { 0033 0034 using type = typename detail::traits< 0035 detail::shallow_decay<T>>::is_reference_member; 0036 }; 0037 0038 #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES 0039 0040 template<typename T> 0041 struct is_reference_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_reference_member_v = //see below 0054 //<- 0055 detail::traits<detail::shallow_decay<T>>::is_reference_member::value; 0056 0057 #endif 0058 0059 }} // namespace boost::callable_traits 0060 //-> 0061 0062 /*` 0063 [heading Constraints] 0064 * none 0065 0066 [heading Behavior] 0067 * `is_reference_member<T>::value` is `true` when either: 0068 * `T` is a function type with a '&' or '&&' member qualifier 0069 * `T` is a pointer to a member function with a '&' or '&&' member qualifiers 0070 * `T` is a function object with a non-overloaded `operator()`, where the `operator()` has a '&' or '&&' member qualifier 0071 * On compilers that support variable templates, `is_reference_member_v<T>` is equivalent to `is_reference_member<T>::value`. 0072 0073 [heading Input/Output Examples] 0074 [table 0075 [[`T`] [`is_reference_member_v<T>`]] 0076 [[`int() &`] [`true`]] 0077 [[`int() const &&`] [`true`]] 0078 [[`int(foo::* const)() &&`] [`true`]] 0079 [[`int(foo::*)(...) volatile &`] [`true`]] 0080 [[`int() const`] [`false`]] 0081 [[`int() volatile`] [`false`]] 0082 [[`int(foo::*)() const`] [`false`]] 0083 [[`int() const`] [`false`]] 0084 [[`int() volatile`] [`false`]] 0085 [[`int(*)()`] [`false`]] 0086 [[`int`] [`false`]] 0087 [[`int foo::*`] [`false`]] 0088 [[`const int foo::*`] [`false`]] 0089 ] 0090 0091 [heading Example Program] 0092 [import ../example/is_reference_member.cpp] 0093 [is_reference_member] 0094 [endsect] 0095 */ 0096 //] 0097 0098 #endif // #ifndef BOOST_CLBL_TRTS_IS_REFERENCE_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 |