ARTICLE AD BOX
I have a struct. I want a custom constructor. I also want to still be able to construct it with a braced list as would be the case if there was no custom constructor. Is it possible?
For example, what can be added to the struct definition so that the lines with the braces don't give an error?
struct foo_t { int foo; double bar; foo_t(int both) : foo(both), bar(both) {} }; foo_t foo0(1); foo_t foo1{.bar = 1}; foo_t foo2{.foo = 2, .bar = 3.0};