Boost logo

Boost :

From: Anthony Williams (anthony_w.geo_at_[hidden])
Date: 2006-11-03 06:30:10

Roland Schwarz <roland.schwarz_at_[hidden]> 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?


> 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.

There is a revised version on the committee wiki, which hopefully will be in
the post-Portland mailing.


Anthony Williams
Software Developer
Just Software Solutions Ltd

Boost list run by bdawes at, gregod at, cpdaniel at, john at