This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

basic_string<>::max_size - only 1MB?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]