Topic: My own personal string...
Author: "Joe O'Leary" <jmoleary@earthlink.net>
Date: 1999/10/24 Raw View
basic_string<> lives in the 'std' namespace. Try this:
typedef std::basic_string<char, std::char_traits<char>, Gallocator<char>
> gString
The xstring header thing is specific to DinkumWare's implementation of the
Standard C++ Library.
Joe O'
maxim <maxk@touro.edu> wrote in message
news:7ulivt$bi2$1@bgtnsc01.worldnet.att.net...
> I would like to typedef a version of basic string with a custom allocator,
> something like this:
>
> typedef basic_string<char, char_traits<char>, Gallocator<char> >
> gstring;
> (adding my own allocator)
>
> Whichever file I tried to do this in, the basic_string class is not
> visible,
> even if <string> is included. I actually looked through <string>, and it
is
> just an implementation file, no classes are defined and no .h files are
> included! I found basic_string in <xstring>, which is an "internal"
(?)file.
> I realize that the answer lies in the STL compilation mechanism, so an
> explaination would be greatly appreciated.
> I get these problems on VC++ 6.0. I am not sure about their
universality...
> max
> ---
> [ comp.std.c++ is moderated. To submit articles, try just posting with ]
> [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
> [ --- Please see the FAQ before posting. --- ]
> [ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: "maxim" <maxk@touro.edu>
Date: 1999/10/21 Raw View
I would like to typedef a version of basic string with a custom allocator,
something like this:
typedef basic_string<char, char_traits<char>, Gallocator<char> >
gstring;
(adding my own allocator)
Whichever file I tried to do this in, the basic_string class is not
visible,
even if <string> is included. I actually looked through <string>, and it is
just an implementation file, no classes are defined and no .h files are
included! I found basic_string in <xstring>, which is an "internal" (?)file.
I realize that the answer lies in the STL compilation mechanism, so an
explaination would be greatly appreciated.
I get these problems on VC++ 6.0. I am not sure about their universality...
max
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]