Cannot convert int (aka NULL) to std::vector<double*>::value_type

Jonathan Wakely
Tue Feb 5 10:28:00 GMT 2013

On 5 February 2013 10:20, Jonathan Wakely wrote:
> On 5 February 2013 10:15, Jonathan Wakely wrote:
>> On 5 February 2013 10:09, Jonathan Wakely wrote:
>>>> Is this a bug in the 4.7.1 compiler or did the compiler change to conform
>>>> to some standard that does not allow vector's to initialized to NULL.
>>> I don't think it changed in quite some time. It's a very well known
>>> problem, see,
>>> but the implementation is supposed to ensure it works.  I can't
>>> remember if we have an open bug about it still.
>> Looking into it further, I think we conform to C++ 2003 + DRs and the
>> workarounds given earlier are necessary.
>> In C++ 2011 the implementation should accept the code, so we'll have
>> to fix that.
> This is the DR we don't implement yet:

It's obviously too early in the morning for me, we've already fixed it
on the trunk:

So it's an unfortunate defect in the C++ 2003 standard that the code
doesn't compile, but G++ is conforming to reject it.  The C++ 2011
standard requires it to compile, and G++ 4.8 will accept it in C++11

More information about the Gcc-help mailing list