123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- #ifndef BOOST_CLBL_TRTS_ADD_NOEXCEPT_HPP
- #define BOOST_CLBL_TRTS_ADD_NOEXCEPT_HPP
- #include <boost/callable_traits/detail/core.hpp>
- namespace boost { namespace callable_traits {
- BOOST_CLBL_TRTS_DEFINE_SFINAE_ERROR_ORIGIN(add_noexcept)
- BOOST_CLBL_TRTS_SFINAE_MSG(add_noexcept, cannot_add_noexcept_to_this_type)
- #ifndef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
- template<typename T>
- struct add_noexcept_t {
- static_assert(std::is_same<T, detail::dummy>::value,
- "noexcept types not supported by this configuration.");
- };
- template<typename T>
- struct add_noexcept {
- static_assert(std::is_same<T, detail::dummy>::value,
- "noexcept types not supported by this configuration.");
- };
- #else
- template<typename T>
- using add_noexcept_t =
- detail::try_but_fail_if_invalid<
- typename detail::traits<T>::add_noexcept,
- cannot_add_noexcept_to_this_type>;
- namespace detail {
- template<typename T, typename = std::false_type>
- struct add_noexcept_impl {};
- template<typename T>
- struct add_noexcept_impl <T, typename std::is_same<
- add_noexcept_t<T>, detail::dummy>::type>
- {
- using type = add_noexcept_t<T>;
- };
- }
- template<typename T>
- struct add_noexcept : detail::add_noexcept_impl<T> {};
- #endif
- }}
- #endif
|