VCCC  2024.05
VisualCamp Common C++ library
is_nothrow_convertible.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 2024/01/15.
3 //
4 
5 #ifndef VCCC_TYPE_TRAITS_IS_NOTHROW_CONVERTIBLE_HPP
6 #define VCCC_TYPE_TRAITS_IS_NOTHROW_CONVERTIBLE_HPP
7 
8 #include <type_traits>
9 
11 
12 namespace vccc {
13 namespace detail {
14 
16 struct is_nothrow_convertible_impl : std::true_type {};
17 
18 template<typename From, typename To>
19 struct is_nothrow_convertible_impl<From, To, false> :
20 #if __cplusplus < 201703L
21  std::true_type
22 #else
23  bool_constant<noexcept( std::declval<void(&)(To) noexcept>()(std::declval<From>()) )>
24 #endif
25  {};
26 } // namespace detail
27 
30 
31 template<typename From, typename To>
32 struct is_nothrow_convertible : detail::is_nothrow_convertible_impl<From, To> {};
33 
35 
36 } // namespace vccc
37 
38 #endif // VCCC_TYPE_TRAITS_IS_NOTHROW_CONVERTIBLE_HPP
std::integral_constant< bool, v > bool_constant
Definition: bool_constant.hpp:19
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
Definition: is_nothrow_convertible.hpp:32