This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
basic_string<>::max_size - only 1MB?
- To: Benjamin Kosnik <bkoz@cygnus.com>
- Subject: basic_string<>::max_size - only 1MB?
- From: Ryszard Kabatek <rysio@rumcajs.chemie.uni-halle.de>
- Date: Tue, 22 Jun 1999 12:57:59 +0200 (CEST)
- cc: libstdc++@sourceware.cygnus.com
- Reply-To: Ryszard Kabatek <kabatek@chemie.uni-halle.de>
The basic_string<>::max_size returns _Rep::_S_max_size.
In the current implementation it is only 1MB*sizeof(CharT).
It is too few!
It prohibits the reading of a file into a string.
BTW. A common way to do it by the template constructor is
after the last change not possible because the specialization
for input iterator was removed. I hope it will be fixed soon.
I think _Rep::_S_max_size should be increased to npos/40 (=100MB) or so.
It is enough for every application and a concatenation of two strings
will still not expand the string size beyond size_type(-1).
Ryszard Kabatek
Martin-Luther University Halle-Wittenberg, Department of Physical Chemistry
Geusaer Str. 88, 06217 Merseburg, Germany
Tel. +49 3461 46 2487 (2466) Fax. +49 3461 46 2129