The aggregate also disappears in C++17 when one of the constructors (or both) is explicit :). The following code fails to compile. struct Point { int x; double y; explicit Point(const Point&) = delete; explicit Point(Point&&) = delete; }; const auto pt = Point{2,3};
Interesting. I can imagine that the reason is that with the explicit, something other than the default definition of the special member functions get deleted. Maybe that makes the difference here.
The aggregate also disappears in C++17 when one of the constructors (or both) is explicit :).
The following code fails to compile.
struct Point {
int x;
double y;
explicit Point(const Point&) = delete;
explicit Point(Point&&) = delete;
};
const auto pt = Point{2,3};
Did you mean to delete the move constructor?
I mean making the deleted constructors explicit
Interesting. I can imagine that the reason is that with the explicit, something other than the default definition of the special member functions get deleted. Maybe that makes the difference here.