If I have an aggregate struct, with default initializers for its members. If I value initialize the aggregate, are the members initialized with the initializers, or are they value initialized?
#include <unordered_map>
#include <array>
#include <iostream>
struct Foo{
std::array<bool, 2> x = {true, true};
};
int main(){
std::unordered_map<int, Foo> f;
std::cout << f[0].x[1];
}
unordered_map::operator[] value initialize the value_type if the key does not exist. Does value initialization of Foo use my default initializer? Is the program guaranteed to output 1?