Topic: Standard ANSI string.h -- where?
Author: "D. Allan Drummond" <allan.drummond@trilogy.com>
Date: 1996/01/11 Raw View
I've been playing around a bit with the HP STL implementation.
Problem: bstring.h (an almost-ANSI-string header) doesn't
contain such simple and useful functions as begin() and end()
(which should return iterators at the beginning and end of the
string). In reading The STL<Primer>, I came across examples
that claim that just these sort of functions exist.
So, where can I find a 'real' ANSI string.h? Is there one in
the public domain? If not, where might I be able to buy one?
Thanks,
Allan
http://www.trilogy.com/home_pages/drummond/index.html
allan.drummond@trilogy.com
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Author: clamage@Eng.Sun.COM (Steve Clamage)
Date: 1996/01/12 Raw View
In article C8A@trilogy.com, "D. Allan Drummond" <allan.drummond@trilogy.com>
writes:
>I've been playing around a bit with the HP STL implementation.
>Problem: bstring.h (an almost-ANSI-string header) doesn't
>contain such simple and useful functions as begin() and end()
>(which should return iterators at the beginning and end of the
>string). In reading The STL<Primer>, I came across examples
>that claim that just these sort of functions exist.
>So, where can I find a 'real' ANSI string.h? Is there one in
>the public domain? If not, where might I be able to buy one?
I think that <bstring.h> is a BSD-Unix-ism. I do know it is not part of
standard C or C++. I don't know whether it is part of POSIX.
The standard header <string.h> must be part of any conforming C and
C++ implementation. If you don't have a conforming C or C++ compiler,
adding someone else's header won't do you any good. The header must
match the library.
P. J. Plauger's book "The Standard C Library" contains a complete
implementation that you could copy. (Pay attention to the copyright
restrictions.) But I would think you would be better off finding out
why your C++ compiler doesn't have a <string.h>, if indeed it does not.
---
Steve Clamage, stephen.clamage@eng.sun.com
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]