2 @file remove_transaction_safe
4 @Copyright Barrett Adair 2015-2017
5 Distributed under the Boost Software License, Version 1.0.
6 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
10 #ifndef BOOST_CLBL_TRTS_REMOVE_TRANSACTION_SAFE_HPP
11 #define BOOST_CLBL_TRTS_REMOVE_TRANSACTION_SAFE_HPP
13 #include <boost/callable_traits/detail/core.hpp>
15 namespace boost { namespace callable_traits {
17 BOOST_CLBL_TRTS_DEFINE_SFINAE_ERROR_ORIGIN(remove_transaction_safe)
18 BOOST_CLBL_TRTS_SFINAE_MSG(remove_transaction_safe, cannot_remove_transaction_safe_from_this_type)
20 //[ remove_transaction_safe_hpp
22 [section:ref_remove_transaction_safe remove_transaction_safe]
24 ``#include <boost/callable_traits/remove_transaction_safe.hpp>``
29 using remove_transaction_safe_t = //see below
31 detail::try_but_fail_if_invalid<
32 typename detail::traits<T>::remove_transaction_safe,
33 cannot_remove_transaction_safe_from_this_type>;
37 template<typename T, typename = std::false_type>
38 struct remove_transaction_safe_impl {};
41 struct remove_transaction_safe_impl <T, typename std::is_same<
42 remove_transaction_safe_t<T>, detail::dummy>::type>
44 using type = remove_transaction_safe_t<T>;
51 struct remove_transaction_safe : detail::remove_transaction_safe_impl<T> {};
54 }} // namespace boost::callable_traits
60 * `T` must be one of the following:
62 * function pointer type
63 * function reference type
64 * member function pointer type
65 * If `T` is a pointer, it may not be cv/ref qualified
68 * A substitution failure occurs if the constraints are violated.
69 * Removes the member `transaction_safe` specifier from `T`, if present.
71 [heading Input/Output Examples]
73 [[`T`] [`remove_transaction_safe_t<T>`]]
74 [[`int() const transaction_safe`] [`int() const`]]
75 [[`int(*)() transaction_safe`] [`int(*)()`]]
76 [[`int(&)() transaction_safe`] [`int(&)()`]]
77 [[`int(foo::*)() transaction_safe`] [`int(foo::*)()`]]
78 [[`int() const`] [`int() const`]]
79 [[`int(*)()`] [`int(*)()`]]
80 [[`int(&)()`] [`int(&)()`]]
81 [[`int`] [(substitution failure)]]
82 [[`int foo::*`] [(substitution failure)]]
83 [[`int (foo::* const)()`] [(substitution failure)]]
86 [heading Example Program]
87 [import ../example/remove_transaction_safe.cpp]
88 [remove_transaction_safe]
93 #endif // #ifndef BOOST_CLBL_TRTS_REMOVE_TRANSACTION_SAFE_HPP