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_NOEXCEPT_HPP
11 #define BOOST_CLBL_TRTS_REMOVE_NOEXCEPT_HPP
13 #include <boost/callable_traits/detail/core.hpp>
15 namespace boost { namespace callable_traits {
17 BOOST_CLBL_TRTS_DEFINE_SFINAE_ERROR_ORIGIN(remove_noexcept)
18 BOOST_CLBL_TRTS_SFINAE_MSG(remove_noexcept, cannot_remove_noexcept_from_this_type)
20 //[ remove_noexcept_hpp
22 [section:ref_remove_noexcept remove_noexcept]
24 ``#include <boost/callable_traits/remove_noexcept.hpp>``
29 using remove_noexcept_t = //see below
31 detail::try_but_fail_if_invalid<
32 typename detail::traits<T>::remove_noexcept,
33 cannot_remove_noexcept_from_this_type>;
37 template<typename T, typename = std::false_type>
38 struct remove_noexcept_impl {};
41 struct remove_noexcept_impl <T, typename std::is_same<
42 remove_noexcept_t<T>, detail::dummy>::type>
44 using type = remove_noexcept_t<T>;
51 struct remove_noexcept : detail::remove_noexcept_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 `noexcept` specifier from `T`, if present.
71 [heading Input/Output Examples]
73 [[`T`] [`remove_noexcept_t<T>`]]
74 [[`int() const noexcept`] [`int() const`]]
75 [[`int(*)() noexcept`] [`int(*)()`]]
76 [[`int(&)() noexcept`] [`int(&)()`]]
77 [[`int(foo::*)() noexcept`] [`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_noexcept.cpp]
93 #endif // #ifndef BOOST_CLBL_TRTS_REMOVE_NOEXCEPT_HPP