Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:34:24

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