possible bug in string::substr and usablity question

Paolo Carlini pcarlini@suse.de
Tue Feb 10 09:32:00 GMT 2004


Jonathan Hudson wrote:

> string::substr does not always return
> the right substring.

To our best knowledge, the implementation always returns the right
substring and indeed your testcase compiles and runs as expected.

Before posting messages pointing out non-existant bugs please study
in detail the concerned sections of the standard or pick a good
book (for strings I suggest Josuttis Ch. 11) (*)

Paolo.

(*) For instance, you will learn that the second argument of substr
is a count not an index.



More information about the Libstdc++ mailing list