Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:29:45

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