Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:29:46

0001 /*
0002 @file remove_transaction_safe
0003 
0004 @Copyright Barrett Adair 2015-2017
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_REMOVE_TRANSACTION_SAFE_HPP
0011 #define BOOST_CLBL_TRTS_REMOVE_TRANSACTION_SAFE_HPP
0012 
0013 #include <boost/callable_traits/detail/core.hpp>
0014 
0015 namespace boost { namespace callable_traits {
0016 
0017 BOOST_CLBL_TRTS_DEFINE_SFINAE_ERROR_ORIGIN(remove_transaction_safe)
0018 BOOST_CLBL_TRTS_SFINAE_MSG(remove_transaction_safe, cannot_remove_transaction_safe_from_this_type)
0019 
0020 //[ remove_transaction_safe_hpp
0021 /*`
0022 [section:ref_remove_transaction_safe remove_transaction_safe]
0023 [heading Header]
0024 ``#include <boost/callable_traits/remove_transaction_safe.hpp>``
0025 [heading Definition]
0026 */
0027 
0028 template<typename T>
0029 using remove_transaction_safe_t = //see below
0030 //<-
0031     detail::try_but_fail_if_invalid<
0032         typename detail::traits<T>::remove_transaction_safe,
0033         cannot_remove_transaction_safe_from_this_type>;
0034 
0035 namespace detail {
0036 
0037     template<typename T, typename = std::false_type>
0038     struct remove_transaction_safe_impl {};
0039 
0040     template<typename T>
0041     struct remove_transaction_safe_impl <T, typename std::is_same<
0042         remove_transaction_safe_t<T>, detail::dummy>::type>
0043     {
0044         using type = remove_transaction_safe_t<T>;
0045     };
0046 }
0047 
0048 //->
0049 
0050 template<typename T>
0051 struct remove_transaction_safe : detail::remove_transaction_safe_impl<T> {};
0052 
0053 //<-
0054 }} // namespace boost::callable_traits
0055 //->
0056 
0057 /*`
0058 
0059 [heading Constraints]
0060 * `T` must be one of the following:
0061   * function type
0062   * function pointer type
0063   * function reference type
0064   * member function pointer type
0065 * If `T` is a pointer, it may not be cv/ref qualified
0066 
0067 [heading Behavior]
0068 * A substitution failure occurs if the constraints are violated.
0069 * Removes the member `transaction_safe` specifier from `T`, if present.
0070 
0071 [heading Input/Output Examples]
0072 [table
0073     [[`T`]                              [`remove_transaction_safe_t<T>`]]
0074     [[`int() const transaction_safe`]   [`int() const`]]
0075     [[`int(*)() transaction_safe`]      [`int(*)()`]]
0076     [[`int(&)() transaction_safe`]      [`int(&)()`]]
0077     [[`int(foo::*)() transaction_safe`] [`int(foo::*)()`]]
0078     [[`int() const`]                    [`int() const`]]
0079     [[`int(*)()`]                       [`int(*)()`]]
0080     [[`int(&)()`]                       [`int(&)()`]]
0081     [[`int`]                            [(substitution failure)]]
0082     [[`int foo::*`]                     [(substitution failure)]]
0083     [[`int (foo::* const)()`]           [(substitution failure)]]
0084 ]
0085 
0086 [heading Example Program]
0087 [import ../example/remove_transaction_safe.cpp]
0088 [remove_transaction_safe]
0089 [endsect]
0090 */
0091 //]
0092 
0093 #endif // #ifndef BOOST_CLBL_TRTS_REMOVE_TRANSACTION_SAFE_HPP