Reputation: 1780
I stumbled over a piece of syntax that I have not seen yet and didn't find online, and I wonder what this is:
constexpr struct X{ /* define X members and methods */ } Y{};
What i don't understand is the Y{}.
Upvotes: 1
Views: 57
Reputation: 10425
constexpr struct X{ /* something here */} Y{};
is equal to
struct X{ /* something here */};
constexpr X Y{};
For constexpr
, check this documentation.
Upvotes: 2