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_ADD_MEMBER_VOLATILE_HPP
0010 #define BOOST_CLBL_TRTS_ADD_MEMBER_VOLATILE_HPP
0011 
0012 #include <boost/callable_traits/detail/core.hpp>
0013 
0014 namespace boost { namespace callable_traits {
0015 
0016 //[ add_member_volatile_hpp
0017 /*`
0018 [section:ref_add_member_volatile add_member_volatile]
0019 [heading Header]
0020 ``#include <boost/callable_traits/add_member_volatile.hpp>``
0021 [heading Definition]
0022 */
0023 
0024 template<typename T>
0025 using add_member_volatile_t = //see below
0026 //<-
0027 #ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
0028 
0029     detail::sfinae_try<
0030         typename detail::traits<T>::add_member_volatile,
0031 
0032         detail::fail_when_same<typename detail::traits<T>::add_member_volatile,
0033                 detail::abominable_functions_not_supported_on_this_compiler,
0034             this_compiler_doesnt_support_abominable_function_types>,
0035 
0036         detail::fail_if_invalid<
0037             typename detail::traits<T>::add_member_volatile,
0038             member_qualifiers_are_illegal_for_this_type>>;
0039 #else
0040 
0041     detail::try_but_fail_if_invalid<
0042         typename detail::traits<T>::add_member_volatile,
0043         member_qualifiers_are_illegal_for_this_type>;
0044 
0045 #endif // #ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
0046 
0047 namespace detail {
0048 
0049     template<typename T, typename = std::false_type>
0050     struct add_member_volatile_impl {};
0051 
0052     template<typename T>
0053     struct add_member_volatile_impl <T, typename std::is_same<
0054         add_member_volatile_t<T>, detail::dummy>::type>
0055     {
0056         using type = add_member_volatile_t<T>;
0057     };
0058 }
0059 //->
0060 
0061 template<typename T>
0062 struct add_member_volatile : detail::add_member_volatile_impl<T> {};
0063 
0064 //<-
0065 }} // namespace boost::callable_traits
0066 //->
0067 
0068 /*`
0069 [heading Constraints]
0070 * `T` must be a function type or a member function pointer type
0071 * If `T` is a pointer, it may not be cv/ref qualified
0072 
0073 [heading Behavior]
0074 * A substitution failure occurs if the constraints are violated.
0075 * Adds a member volatile qualifier to `T`, if not already present.
0076 
0077 [heading Input/Output Examples]
0078 [table
0079     [[`T`]                              [`add_member_volatile_t<T>`]]
0080     [[`int()`]                          [`int() volatile`]]
0081     [[`int(foo::*)()`]                  [`int(foo::*)() volatile`]]
0082     [[`int(foo::*)() &`]                [`int(foo::*)() volatile &`]]
0083     [[`int(foo::*)() &&`]               [`int(foo::*)() volatile &&`]]
0084     [[`int(foo::*)() const`]            [`int(foo::*)() const volatile`]]
0085     [[`int(foo::*)() transaction_safe`] [`int(foo::*)() volatile transaction_safe`]]
0086     [[`int`]                            [(substitution failure)]]
0087     [[`int (&)()`]                      [(substitution failure)]]
0088     [[`int (*)()`]                      [(substitution failure)]]
0089     [[`int foo::*`]                     [(substitution failure)]]
0090     [[`int (foo::* const)()`]           [(substitution failure)]]
0091 ]
0092 
0093 [heading Example Program]
0094 [import ../example/add_member_volatile.cpp]
0095 [add_member_volatile]
0096 [endsect][/section:ref_add_member_volatile]
0097 */
0098 //]
0099 
0100 #endif