Re: basic_string ctor



John wrote:
> Hi,
>
> Is it legal C++ (by which I mean according to the standard spec) to
> pass a null into a basic_string ctor? Or, more precisely, is it
> legal C++ to pass a null pointer into a basic_string parameter on a
> method?

No, it's not. The committee was worried about the cost of the extra if() in
the constructor being too high (misplaced premature optimization, IMO).

Many C++ library implementations will in fact crash if you pass null.

-cd


.