If I have

    struct Foo { int a, b; }
    struct Bar : Foo { using Foo::Foo; int c; }

Can I do

    auto bar = Bar{.a = 1, .b = 2, .c = 3};  // ?

if so, I think it might remove some concerns
over Designated-initializers for Base Classes (open-std.org)

--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
_______________________________________________

On Saturday, April 6th, 2024 at 9:36 PM, David Ledger via Std-Proposals <std-proposals@lists.isocpp.org> wrote:

Hello everybody!!

Right now, this will not compile:

 

struct Foo { int a, b; }
struct Bar : Foo { using Foo::Foo; }
auto bar = Bar{1, 2}; // ERROR
 

Which is confusing and unintuitive. This paper proposes an improvement to this behaviour.

https://seppeon.gitlab.io/cpp-proposals/inheritance-of-aggregate-initialization.html#_abstract

 

Regards,

David Ledger