24 stream <<
"\n--- File Contents Summary ---\n\n1. Conversion from std::tuple to other container classes" <<
endL;
26 stream <<
"2. Conversion from std::array to other container classes" <<
endL;
28 stream <<
"For details, read the source code below." <<
endL;
34 stream <<
"--- Conversion from std::tuple to other container classes" <<
endL;
36 std::tuple t1 { 1, 3.5, 4.6f, 2.3f, 3u };
41 stream <<
"std::tuple "<<t1<<
" is converted to std::array " << a1 <<
endL;
45 stream <<
"std::array "<< a1 <<
" is converted to std::tuple " << t2 <<
endL;
47 auto v1 = types::convert_to_container<std::vector>(t1);
49 stream <<
"std::tuple "<< t1 <<
" is converted to std::vector " << v1 <<
endL;
51 auto d1 = types::convert_to_container<std::deque>(t1);
53 stream <<
"std::tuple "<< t1 <<
" is converted to std::deque " << d1 <<
endL;
60 auto vv = types::convert_to_container<vector_of_variants_t>(t1);
63 stream <<
"std::tuple "<< t1 <<
" is converted to vector of variants " << vv <<
endL;
70 auto dv = types::convert_to_container<deque_of_variants_t>(t1);
73 stream <<
"std::tuple "<< t1 <<
" is converted to deque of variants " << dv <<
endL;
79 stream <<
"--- Conversion from std::array to other container classes" <<
endL;
81 std::array a1 { 1.3, 3.5, 4.6, 2.3, 3.0 };
86 stream <<
"std::array "<< a1 <<
" is converted to std::tuple " << t1 <<
endL;
88 auto v1 = types::convert_to_container<std::vector>(a1);
90 stream <<
"std::array "<< a1 <<
" is converted to std::vector " << v1 <<
endL;
92 auto d1 = types::convert_to_container<std::deque>(t1);
94 stream <<
"std::array "<< a1 <<
" is converted to std::deque " << d1 <<
endL;
96 auto ms = types::convert_to_container<std::multiset>(a1);
98 stream <<
"std::array "<< a1 <<
" is converted to multiset " << ms <<
endL;
100 auto ums = types::convert_to_container<std::unordered_multiset>(a1);
102 stream <<
"std::array "<< a1 <<
" is converted to unordered_multiset " << ums <<
endL;
104 stream <<
"\t\t--- By Thomas Kim, Feb. 05, 2020. ---" <<
endl;
void test_conversion_from_tuple_to_container()
void summary_array_tuple_converstion()
void test_conversion_from_array_to_container()
container_of_variants_t< std::vector, ElementTypes... > vector_of_variants_t
container_of_variants_t< std::deque, ElementTypes... > deque_of_variants_t
Type to string name conversions are defined.
auto convert_to_array(const std::tuple< Type, Types... > &tuple)
Container< types::to_variant_t< remove_cvref_t< TupleType > > > tuple_to_container_of_variants_t
auto convert_to_tuple(const std::array< T, Size > &array)
Stream output operators << are implemented.
Type functions are implemented.
#define Tpf_GetTypeCategory(instance_arg)
A macro that returns instance_arg's type category string name.