New const char* ctor for C++-0x

Ed Smith-Rowland 3dw4rd@verizon.net
Wed Dec 23 14:00:00 GMT 2009


Jonathan Wakely wrote:
> 2009/12/23 Ed Smith-Rowland:
>   
>> +  const char * str01 = "010101000011";
>> +  std::bitset<n1> bit01(str01);
>>     
>
> Wouldn't this have passed anyway, without the new constructor?  I
> believe the point of the new constructor is to avoid the overhead of
> creating a std::string, but this test doesn't verify that.
> How about a type with a conversion to char* so that it would take too
> many conversions to go via the std::string constructor?
>
>   
I actually tried it under C++-03 by accident and it didn't like illegal 
conversion from pointer to unsigned long.
It didn't try the string ctor.



More information about the Libstdc++ mailing list