add_member_volatile.hpp
Go to the documentation of this file.
1 /*
2 
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)
6 
7 */
8 
9 #ifndef BOOST_CLBL_TRTS_ADD_MEMBER_VOLATILE_HPP
10 #define BOOST_CLBL_TRTS_ADD_MEMBER_VOLATILE_HPP
11 
13 
14 namespace boost { namespace callable_traits {
15 
16 //[ add_member_volatile_hpp
17 /*`
18 [section:ref_add_member_volatile add_member_volatile]
19 [heading Header]
20 ``#include <boost/callable_traits/add_member_volatile.hpp>``
21 [heading Definition]
22 */
23 
24 template<typename T>
25 using add_member_volatile_t = //see below
26 //<-
27 #ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
28 
31 
33  detail::abominable_functions_not_supported_on_this_compiler,
34  this_compiler_doesnt_support_abominable_function_types>,
35 
38  member_qualifiers_are_illegal_for_this_type>>;
39 #else
40 
43  member_qualifiers_are_illegal_for_this_type>;
44 
45 #endif // #ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
46 
47 namespace detail {
48 
49  template<typename T, typename = std::false_type>
51 
52  template<typename T>
53  struct add_member_volatile_impl <T, typename std::is_same<
54  add_member_volatile_t<T>, detail::dummy>::type>
55  {
57  };
58 }
59 //->
60 
61 template<typename T>
63 
64 //<-
65 }} // namespace boost::callable_traits
66 //->
67 
68 /*`
69 [heading Constraints]
70 * `T` must be a function type or a member function pointer type
71 * If `T` is a pointer, it may not be cv/ref qualified
72 
73 [heading Behavior]
74 * A substitution failure occurs if the constraints are violated.
75 * Adds a member volatile qualifier to `T`, if not already present.
76 
77 [heading Input/Output Examples]
78 [table
79  [[`T`] [`add_member_volatile_t<T>`]]
80  [[`int()`] [`int() volatile`]]
81  [[`int(foo::*)()`] [`int(foo::*)() volatile`]]
82  [[`int(foo::*)() &`] [`int(foo::*)() volatile &`]]
83  [[`int(foo::*)() &&`] [`int(foo::*)() volatile &&`]]
84  [[`int(foo::*)() const`] [`int(foo::*)() const volatile`]]
85  [[`int(foo::*)() transaction_safe`] [`int(foo::*)() volatile transaction_safe`]]
86  [[`int`] [(substitution failure)]]
87  [[`int (&)()`] [(substitution failure)]]
88  [[`int (*)()`] [(substitution failure)]]
89  [[`int foo::*`] [(substitution failure)]]
90  [[`int (foo::* const)()`] [(substitution failure)]]
91 ]
92 
93 [heading Example Program]
94 [import ../example/add_member_volatile.cpp]
95 [add_member_volatile]
96 [endsect][/section:ref_add_member_volatile]
97 */
98 //]
99 
100 #endif
sfinae_try< T, fail_when_same< U, invalid_type, ErrorType >, fail_when_same< U, reference_error, reference_type_not_supported_by_this_metafunction > > try_but_fail_if_invalid
Definition: utility.hpp:58
typename BOOST_CLBL_TRTS_DISJUNCTION(function_object< unwrap_reference< T > >, function< T >, pmf< T >, pmd< T >, default_callable_traits< T >)::traits traits
Definition: traits.hpp:25
typename BOOST_CLBL_TRTS_DISJUNCTION(FailIfs..., success< T >)::_::type sfinae_try
detail::try_but_fail_if_invalid< typename detail::traits< T >::add_member_volatile, member_qualifiers_are_illegal_for_this_type > add_member_volatile_t