Back to home page

EIC code displayed by LXR

 
 

    


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

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_REMOVE_MEMBER_REFERENCE_HPP
0010 #define BOOST_CLBL_TRTS_REMOVE_MEMBER_REFERENCE_HPP
0011 
0012 #include <boost/callable_traits/detail/core.hpp>
0013 
0014 namespace boost { namespace callable_traits {
0015 
0016 //[ remove_member_reference_hpp
0017 /*`
0018 [section:ref_remove_member_reference remove_member_reference]
0019 [heading Header]
0020 ``#include <boost/callable_traits/remove_member_reference.hpp>``
0021 [heading Definition]
0022 */
0023 
0024 template<typename T>
0025 using remove_member_reference_t = //see below
0026 //<-
0027     detail::try_but_fail_if_invalid<
0028         typename detail::traits<T>::remove_member_reference,
0029         member_qualifiers_are_illegal_for_this_type>;
0030 
0031 namespace detail {
0032 
0033     template<typename T, typename = std::false_type>
0034     struct remove_member_reference_impl {};
0035 
0036     template<typename T>
0037     struct remove_member_reference_impl <T, typename std::is_same<
0038         remove_member_reference_t<T>, detail::dummy>::type>
0039     {
0040         using type = remove_member_reference_t<T>;
0041     };
0042 }
0043 
0044 //->
0045 
0046 template<typename T>
0047 struct remove_member_reference
0048   : detail::remove_member_reference_impl<T> {};
0049 
0050 //<-
0051 }} // namespace boost::callable_traits
0052 //->
0053 
0054 /*`
0055 [heading Constraints]
0056 * `T` must be a function type or a member function pointer type
0057 * If `T` is a pointer, it may not be cv/ref qualified
0058 
0059 [heading Behavior]
0060 * A substitution failure occuers if the constraints are violated.
0061 * Removes member `&` or `&&` qualifiers from `T`, if present.
0062 
0063 [heading Input/Output Examples]
0064 [table
0065     [[`T`]                              [`remove_member_const_t<T>`]]
0066     [[`int() &`]                        [`int()`]]
0067     [[`int(foo::*)() &`]                [`int(foo::*)()`]]
0068     [[`int(foo::*)() const &`]          [`int(foo::*)() const`]]
0069     [[`int(foo::*)() const &&`]         [`int(foo::*)() const`]]
0070     [[`int(foo::*)()`]                  [`int(foo::*)()`]]
0071     [[`int`]                            [(substitution failure)]]
0072     [[`int (&)()`]                      [(substitution failure)]]
0073     [[`int (*)()`]                      [(substitution failure)]]
0074     [[`int foo::*`]                     [(substitution failure)]]
0075     [[`int (foo::* const)()`]           [(substitution failure)]]
0076 ]
0077 
0078 [heading Example Program]
0079 [import ../example/remove_member_reference.cpp]
0080 [remove_member_reference]
0081 [endsect]
0082 */
0083 //]
0084 
0085 #endif // #ifndef BOOST_CLBL_TRTS_REMOVE_MEMBER_REFERENCE_HPP