VCCC  2024.05
VisualCamp Common C++ library
is_list_initializable.hpp
Go to the documentation of this file.
1 //
2 // Created by YongGyu Lee on 11/3/23.
3 //
4 
5 #ifndef VCCC_TYPE_TRAITS_IS_LIST_INITIALIZABLE_HPP
6 #define VCCC_TYPE_TRAITS_IS_LIST_INITIALIZABLE_HPP
7 
8 #include <type_traits>
9 
11 
12 namespace vccc {
13 
16 
17 namespace detail {
18 
19 template<typename To, typename From, typename = void>
20 struct is_list_initializable_impl : std::false_type {};
21 
22 template<typename To, typename From>
23 struct is_list_initializable_impl<To, From, void_t<decltype(To{std::declval<From>()})>> : std::true_type {};
24 
25 } // namespace detail
26 
31 template<typename To, typename From>
32 struct is_list_initializable : detail::is_list_initializable_impl<To, From> {};
33 
34 template<typename To, typename From>
36 
38 
39 
44 template<typename To, typename From>
45 struct is_copy_list_initializable : std::conditional_t<is_list_initializable<To, From>::value, std::is_convertible<From, To>, std::false_type> {};
46 
47 template<typename To, typename From>
49 
51 
53 
54 } // namespace vccc
55 
56 #endif // VCCC_TYPE_TRAITS_IS_LIST_INITIALIZABLE_HPP
typename is_copy_list_initializable< To, From >::type is_copy_list_initializable_t
Definition: is_list_initializable.hpp:48
typename is_list_initializable< To, From >::type is_list_initializable_t
Definition: is_list_initializable.hpp:35
void void_t
Definition: void_t.hpp:19
Definition: directory.h:12
Definition: is_list_initializable.hpp:45
Definition: is_list_initializable.hpp:32