This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: a string problem



> % 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]