This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: basic_string<>::max_size - only 1MB?
- To: Ryszard Kabatek <kabatek@chemie.uni-halle.de>
- Subject: Re: basic_string<>::max_size - only 1MB?
- From: Nicolai Josuttis <nicolai.josuttis@braunschweig.netsurf.de>
- Date: Thu, 24 Jun 1999 16:52:32 +0200
- CC: libstdc++ <libstdc++@sourceware.cygnus.com>
- Organization: Solutions in Time
- References: <Pine.LNX.3.96.990624160538.17165A-100000@rumcajs.chemie.uni-halle.de>
- Reply-To: solutions@josuttis.de
Ryszard Kabatek wrote:
>
> BTW. Must the value of npos be size_type(-1) ?
>
Yes, the standard requires the following declaration:
> namespace std {
> template<class charT,
> class traits = char_traits<charT>,
> class Allocator = allocator<charT> >
> class basic_string {
> public:
> typedef typename Allocator::size_type size_type;
> ...
> static const size_type npos = -1;
> ...
> };
> }
This wasn't a very well decision because it causes a LOT of trouble.
--
Nicolai M. Josuttis
Solutions in Time
http://www.josuttis.de/
mailto:solutions@josuttis.de