Boost logo

Boost Users :

Subject: Re: [Boost-users] [review][assign] Formal review of Assign v2 ongoing
From: Simonson, Lucanus J (lucanus.j.simonson_at_[hidden])
Date: 2011-06-21 18:55:53

er wrote:
>> Arguably the extra {} around each vector element in the new
>> initializer syntax is more readable than the proposed assign v2
>> syntax. Tuple and deque support initializer list as do all classes
>> with constructors and structs.
> I have to believe that you are right in principle, because I'm not too
> well versed in intialization lists, and thanks for spotting it. But
> few compilers already fully support C++0x. In the case of gcc4.4 that
> I use, which has proven C++0x conformant until now, I get the
> compiler error "converting from initializer list would use explicit
> constructor".

If it is true that you cannot use an initializer list with an explicit constructor in the new standard I think it will make explict constructors very painful. I may not have reasoned it through fully, but I see no reason not to allow initializer lists to use explict constructors. It doesn't seem to create safety concerns or ambiguity. Does someone know the rationale for that? It seems to be a mistake to me.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at