a string problem

Benjamin Kosnik bkoz@cygnus.com
Tue Oct 12 13:29:00 GMT 1999


> % cat foo.cc
> #include <string>
> 
> void foo() { std::string s(10,0); }

whoops. This is not a compiler or library implementation bug--the
arugments get deduced as iterators, as you pointed out earlier. You'll
have to cast to 

string s(10, char(0)) to call the constructor that you're intending.

-benjamin



More information about the Libstdc++ mailing list