10 using name_t =
const char*;
12 using weight_t = double;
18 my_set.emplace(
"Thomas Kim");
25 types::variant_handlers handle_map
29 stream <<
"I am " << age <<
" years old. " <<
endl;
34 stream <<
"Weight is " << weight <<
" kg. " <<
endl;
39 stream <<
"My name is " << name <<
". " <<
endl;
44 stream <<
"Possibly wrong parameter definition: "
49 handle_map.for_each(my_set);
55 using category_t =
const char*;
56 using name_t = std::string;
58 using weight_t = double;
65 info[
"Tom's name"] =
"Thomas Kim";
66 info[
"Toms' age"] = 20;
67 info[
"Tom's weight"] = 60.5;
72 types::variant_handlers handle_map
74 [&
stream, &
endl](
const category_t& key, name_t& name)
79 [&
stream, &
endl](
const category_t& key, age_t& age)
84 [&
stream, &
endl](
const category_t& key, weight_t& weight)
89 [&
stream, &
endl](
const category_t& key,
auto catch_all)
95 handle_map.for_each(info);
101 using category_t =
const char*;
102 using name_t = std::string;
104 using weight_t = double;
111 info[
"Tom's name"] =
"Thomas Kim";
112 info[
"Toms' age"] = 20;
113 info[
"Tom's weight"] = 60.5;
118 types::variant_handlers handle_map
120 [&
stream, &
endl](
const category_t& key, name_t& name)
125 [&
stream, &
endl](
const category_t& key, age_t& age)
130 [&
stream, &
endl](
const category_t& key, weight_t& weight)
135 [&
stream, &
endl](
const category_t& key,
auto catch_all)
141 handle_map.for_each(info);
147 using category_t =
const char*;
148 using name_t = std::string;
150 using weight_t = double;
156 info.emplace(
"Tom's name",
"Thomas Kim");
157 info.emplace(
"Toms' age", 20);
158 info.emplace(
"Tom's weight", 60.5);
162 auto& [key, value] = p;
170 using category_t =
const char*;
171 using name_t =
const char*;
173 using weight_t = double;
177 using key_type = map_t::key_type;
178 using value_type = map_t::value_type;
182 info[
"Tom's name"] =
"Thomas Kim";
183 info[
"Toms' age"] = 20;
184 info[
"Tom's weight"] = 60.5;
189 types::variant_handlers handle_map
191 [&
stream, &
endl](
const category_t& key, name_t& value)
196 [&
stream, &
endl](
const category_t& key, age_t& value)
201 [&
stream, &
endl](
const category_t& key, weight_t& value)
207 handle_map.for_each(info);
213 using category_t =
const char*;
214 using name_t = std::string;
216 using weight_t = double;
222 info.emplace(
"Tom's name",
"Thomas Kim");
223 info.emplace(
"Toms' age", 20);
224 info.emplace(
"Tom's weight", 60.5);
229 types::variant_handlers handle_map
231 [&
stream, &
endl](
const category_t& key, name_t& name)
236 [&
stream, &
endl](
const category_t& key, age_t& age)
241 [&
stream, &
endl](
const category_t& key, weight_t& weight)
247 handle_map.for_each(info);
250 handle_map.for_each_reverse(info);
std::deque< element_t > set_t
void test_handle_unordered_maps()
void test_map_of_variants()
void test_unordered_map_of_variants()
void test_set_of_variants()
void test_multimap_of_variants()
Type to string name conversions are defined.
hidden::unordered_multimap_of_variants_t< KeyType, ElementTypes... > unordered_multimap_of_variants_t
hidden::map_of_variants_t< KeyType, ElementTypes... > map_of_variants_t
hidden::multimap_of_variants_t< KeyType, ElementTypes... > multimap_of_variants_t
hidden::set_of_variants_t< ElementTypes... > set_of_variants_t
hidden::unordered_map_of_variants_t< KeyType, ElementTypes... > unordered_map_of_variants_t
Stream output operators << are implemented.
#define Tpf_GetTypeCategory(instance_arg)
A macro that returns instance_arg's type category string name.