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 
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_QUALIFIED_class_of_HPP
0011 #define BOOST_CLBL_TRTS_QUALIFIED_class_of_HPP
0012 
0013 #include <boost/callable_traits/detail/core.hpp>
0014 
0015 namespace boost { namespace callable_traits {
0016 
0017 //[ qualified_class_of_hpp
0018 /*`
0019 [section:ref_qualified_class_of qualified_class_of]
0020 [heading Header]
0021 ``#include <boost/callable_traits/qualified_class_of.hpp>``
0022 [heading Definition]
0023 */
0024 
0025 template<typename T>
0026 using qualified_class_of_t = //see below
0027 //<-
0028     detail::try_but_fail_if_invalid<
0029         typename detail::traits<detail::shallow_decay<T>>::invoke_type,
0030         type_is_not_a_member_pointer>;
0031 
0032 namespace detail {
0033 
0034     template<typename T, typename = std::false_type>
0035     struct qualified_class_of_impl {};
0036 
0037     template<typename T>
0038     struct qualified_class_of_impl <T, typename std::is_same<
0039         qualified_class_of_t<T>, detail::dummy>::type>
0040     {
0041         using type = qualified_class_of_t<T>;
0042     };
0043 }
0044 
0045 //->
0046 
0047 template<typename T>
0048 struct qualified_class_of : detail::qualified_class_of_impl<T> {};
0049 
0050 //<-
0051 }} // namespace boost::callable_traits
0052 //->
0053 
0054 /*`
0055 [heading Constraints]
0056 * `T` must be a member pointer
0057 
0058 [heading Behavior]
0059 * A substitution failure occurs if the constraints are violated.
0060 * If `T` is a member function pointer, the aliased type is the parent class of the member, qualified according to the member qualifiers on `T`. If `T` does not have a member reference qualifier, then the aliased type will be an lvalue reference.
0061 * If `T` is a member data pointer, the aliased type is equivalent to `ct::class_of<T> const &`.
0062 
0063 [heading Input/Output Examples]
0064 [table
0065     [[`T`]                              [`qualified_class_of_t<T>`]]
0066     [[`void(foo::*)()`]                 [`foo &`]]
0067     [[`void(foo::* volatile)() const`]           [`foo const &`]]
0068     [[`void(foo::*)() &&`]              [`foo &&`]]
0069     [[`void(foo::*&)() volatile &&`]     [`foo volatile &&`]]
0070     [[`int foo::*`]                     [`foo const &`]]
0071     [[`const int foo::*`]               [`foo const &`]]
0072 ]
0073 
0074 [heading Example Program]
0075 [import ../example/qualified_class_of.cpp]
0076 [qualified_class_of]
0077 [endsect]
0078 */
0079 //]
0080 
0081 #endif // #ifndef BOOST_CLBL_TRTS_QUALIFIED_class_of_HPP