Bug#158988: g++-3.2: char_traits template does not have a implementation
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Saturday 31 August 2002 22:07, Phil Edwards wrote:
> On Sat, Aug 31, 2002 at 02:17:45PM +0200, Tobias Hunger wrote:
> > bits/char_traits.h Defines the char_traits template without providing a
> > default implementation, only specialisations for char and wchar_t.
>
> This is by design.
/me sighs.
> > This
> > is very annoying as you need to fill in all the gory details if you want
> > to have a string of something else (like string<size_t> to hold a list
>
> Well, yeah. "all the gory details" /depend/ on the type you choose;
> they cannot be guessed by a default implementation.
Not really;-) You mostly need to adjust for sizeof(T). Find can't be done with
a fast mem* operation either, but that can be 'fixed' by the char
specialisation. Well, I might be far off, you should know better then me:-)
Something else I notized: I was able to specialize the template for a class of
mine (template<> struct std::char_traits<Babylon::Char> { blah }), but not
for size_t. template<> struct std::char_traits<size_t> { blah } complained
about that being a redefinition with the other one occuring in
/usr/include/c++/3.2/bits/char_traits.h line 55.
- --
Gruss,
Tobias
- ------------------------------------------------------------
Tobias Hunger The box said: 'Windows 95 or better'
tobias@fresco.org So I installed Linux.
- ------------------------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE9cd0vv0FZW3NyoqURArPiAJ42vATYdJP/+xg3c0As+KjQMP+1RwCgibm1
ett2SzvoTkiSpAlQ/bNIsWM=
=TI4J
-----END PGP SIGNATURE-----
Reply to: