Date
2012-09-24.00:00:00
Message id
3468

Content

One would expect that an example like

  struct B {
   B(const B&) = default;
  };

  B b{};

would invoke value-initialization, but (because it does not have a default constructor), the logic ladder of 9.5.5 [dcl.init.list] paragraph 3 makes it aggregate initialization instead:

  • If the initializer list has no elements and T is a class type with a default constructor, the object is value-initialized.

  • Otherwise, if T is an aggregate, aggregate initialization is performed (9.5.2 [dcl.init.aggr]).