This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Core dump constructing a C++ string with NULL
On Fri, Jan 14, 2011 at 10:47, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On 14 January 2011 16:19, Tom Browder wrote:
>>
>> How about a compiler option then, something like
>> "--allow-c++-null-string-constructor"...
>
> We throw an exception, std::logic_error, indicating a precondition violation.
Two questions:
1. does it take any significant time difference to check for a 0
versus throw an exception (one argument against)?
2. Isn't a '\0' an empty string in the string context?
Respectfully,
-Tom