For example, nlohmann json has a way of converting an aggregate initializer list to a JSON object:
json j = {
{"pi", 3.141},
{"happy", true},
{"name", "Niels"},
{"nothing", nullptr},
{"answer", {
{"everything", 42}
}},
{"list", {1, 0, 2}},
{"object", {
{"currency", "USD"},
{"value", 42.99}
}}
};
and c++ std::map also has a aggeragte initalizer list
{
{"one": 1},
{"two": 2}
}
I'm curious about how you can write a custom (aggregate) initalizer list initalizer