I have a struct, one of whose members is a std::stack using a std::array as its underlying container:
struct S {
int a, b; // dummy members
std::stack<
int,
std::array<int, 10>
> st;
};
I would like to use brace initialization to initialize all members of an S
struct, something like:
S const obj {
1, // a
2, // b
{1, 2, 3} /* st
^
I want this at the top of the stack */
};
Is this kind of initialization possible for std::stack? If yes, what would the syntax be?