3 @Copyright Barrett Adair 2015-2017
4 Distributed under the Boost Software License, Version 1.0.
5 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
9 #ifndef BOOST_CLBL_TRTS_REMOVE_MEMBER_CONST_HPP
10 #define BOOST_CLBL_TRTS_REMOVE_MEMBER_CONST_HPP
12 #include <boost/callable_traits/detail/core.hpp>
14 namespace boost { namespace callable_traits {
16 //[ remove_member_const_hpp
18 [section:ref_remove_member_const remove_member_const]
20 ``#include <boost/callable_traits/remove_member_const.hpp>``
25 using remove_member_const_t = //see below
27 detail::try_but_fail_if_invalid<
28 typename detail::traits<T>::remove_member_const,
29 member_qualifiers_are_illegal_for_this_type>;
33 template<typename T, typename = std::false_type>
34 struct remove_member_const_impl {};
37 struct remove_member_const_impl <T, typename std::is_same<
38 remove_member_const_t<T>, detail::dummy>::type>
40 using type = remove_member_const_t<T>;
47 struct remove_member_const : detail::remove_member_const_impl<T> {};
50 }} // namespace boost::callable_traits
55 * `T` must be a function type or a member function pointer type
56 * If `T` is a pointer, it may not be cv/ref qualified
59 * A substitution failure occurs if the constraints are violated.
60 * Removes the member `const` qualifier from `T`, if present.
62 [heading Input/Output Examples]
64 [[`T`] [`remove_member_const_t<T>`]]
65 [[`int() const`] [`int()`]]
66 [[`int(foo::*)() const`] [`int(foo::*)()`]]
67 [[`int(foo::*)() const &`] [`int(foo::*)() &`]]
68 [[`int(foo::*)() const &&`] [`int(foo::*)() &&`]]
69 [[`int(foo::*)() const`] [`int(foo::*)()`]]
70 [[`int(foo::*)() const volatile`] [`int(foo::*)() volatile`]]
71 [[`int`] [(substitution failure)]]
72 [[`int (&)()`] [(substitution failure)]]
73 [[`int (*)()`] [(substitution failure)]]
74 [[`int foo::*`] [(substitution failure)]]
75 [[`int (foo::* const)()`] [(substitution failure)]]
78 [heading Example Program]
79 [import ../example/remove_member_const.cpp]
85 #endif // #ifndef BOOST_CLBL_TRTS_REMOVE_MEMBER_CONST_HPP