
Roland Schwarz <roland.schwarz@chello.at> writes:
Anthony Williams wrote:
struct A { constexpr A(int i_): i(i_),j(0) {}
int i; int j; };
static A a(6); // static initialization, same as {6,0}, but with a constructor.
And such a struct shall be aggregate?
No.
What if there is something in the body of the ctor?
That's not allowed. The members can be initialized with "constant expressions" in the member init list. Constant expressions are generalized to include calls to functions which are themselves marked constexpr. N1980 is the latest public version of the proposal. http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2006/n1980.pdf There is a revised version on the committee wiki, which hopefully will be in the post-Portland mailing. Anthony -- Anthony Williams Software Developer Just Software Solutions Ltd http://www.justsoftwaresolutions.co.uk