Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:44:13

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_IS_CV_MEMBER_HPP
0010 #define BOOST_CLBL_TRTS_IS_CV_MEMBER_HPP
0011 
0012 #include <boost/callable_traits/detail/core.hpp>
0013 
0014 namespace boost { namespace callable_traits {
0015 
0016 //[ is_cv_member_hpp
0017 /*`[section:ref_is_cv_member is_cv_member]
0018 [heading Header]
0019 ``#include <boost/callable_traits/is_cv_member.hpp>``
0020 [heading Definition]
0021 */
0022 
0023 // inherits from either std::true_type or std::false_type
0024 template<typename T>
0025 struct is_cv_member;
0026 
0027 //<-
0028 template<typename T>
0029 struct is_cv_member
0030     : detail::traits<detail::shallow_decay<T>>::is_cv_member {
0031     using type = typename detail::traits<
0032         detail::shallow_decay<T>>::is_cv_member;
0033 };
0034 
0035 #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES
0036 
0037 template<typename T>
0038 struct is_cv_member_v {
0039     static_assert(std::is_same<T, detail::dummy>::value,
0040         "Variable templates not supported on this compiler.");
0041 };
0042 
0043 #else
0044 //->
0045 // only available when variable templates are supported
0046 template<typename T>
0047 //<-
0048 BOOST_CLBL_TRAITS_INLINE_VAR
0049 //->
0050 constexpr bool is_cv_member_v = //see below
0051 //<-
0052     detail::traits<detail::shallow_decay<T>>::is_cv_member::value;
0053 
0054 #endif
0055 
0056 }} // namespace boost::callable_traits
0057 //->
0058 
0059 /*`
0060 [heading Constraints]
0061 * none
0062 
0063 [heading Behavior]
0064 * `is_cv_member<T>::value` is `true` when either:
0065   * `T` is a function type with both `const` and `volatile` member qualifiers
0066   * `T` is a pointer to a member function with both `const` and `volatile` member qualifiers
0067   * `T` is a function object with a non-overloaded `operator()`, where the `operator()` has both `const` and `volatile` member qualifiers
0068 * On compilers that support variable templates, `is_cv_member_v<T>` is equivalent to `is_cv_member<T>::value`.
0069 
0070 [heading Input/Output Examples]
0071 [table
0072     [[`T`]                              [`is_cv_member_v<T>`]]
0073     [[`int() const volatile`]           [`true`]]
0074     [[`int() const volatile &`]         [`true`]]
0075     [[`int(foo::* const &)() const volatile`] [`true`]]
0076     [[`int() const`]                    [`false`]]
0077     [[`int() volatile`]                 [`false`]]
0078     [[`int(foo::*)() const`]            [`false`]]
0079     [[`int() const`]                    [`false`]]
0080     [[`int() volatile`]                 [`false`]]
0081     [[`int() &&`]                       [`false`]]
0082     [[`int(*)()`]                       [`false`]]
0083     [[`int`]                            [`false`]]
0084     [[`int foo::*`]                     [`false`]]
0085     [[`const int foo::*`]               [`false`]]
0086 ]
0087 
0088 [heading Example Program]
0089 [import ../example/is_cv_member.cpp]
0090 [is_cv_member]
0091 [endsect]
0092 */
0093 //]
0094 
0095 #endif // #ifndef BOOST_CLBL_TRTS_IS_CV_MEMBER_HPP