Mail Archives: djgpp/2000/11/02/17:31:17
Rodeo Red wrote:
> yes I really don't need the functions right now, but I always wondered
> where they were. Thanks for clearing that up.
It turns out that the source is there anyway if you want to see it -
it's in the file c:\djgpp\lang\cxx\std\bastring.cc. (I don't know why
that's there though, since I'm sure DJGPP just uses the library file.)
> It appears I misunderstood the text of Lippman and Lajoie - I just want
> to emphasize that as far as I can tell it is a good reliable book. I've
> had my share of bad book so I appreciate it.
> they used
> replace( vec.begin(), vec.end(), oldval, newval);
> whre old val and new val are strings, in a vector. I mistakenly used
> replace (str.begin(), str.end(), oldval, newval) ;
>
> Which doesn't work because old val and new val are strings in a
> string.
> I'm still a little confused with the terminology-
> A string is a container but each character is an element in itself -
> right ?
Things such as deques, lists, queues, stacks, vectors, sets, maps, etc.
are containers. The standard doesn't seem to refer to basic_strings as
containers[*], but they are clearly containers of a sort. The items held
in a container (or a basic_string) are called elements. Of course, you
can have types like vector<list<string>> where the elements are themselves
containers.
[*] mainly, I think, because there are severe restrictions on what they
can contain
- Raw text -