Core dump constructing a C++ string with NULL

Tom Browder tom.browder@gmail.com
Thu Jan 13 19:56:00 GMT 2011


It would be nice if this would construct an empty string:

  #include <string>
  std::string s(0);

At the moment that gives a core dump.

Is that defined behavior according to the standard?  If not, what
about a g++ enhancement?

Thanks.

Regards.

-Tom

Thomas M. Browder, Jr.
Niceville, Florida
USA



More information about the Gcc-help mailing list