This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: [Bug c++/11108] <iostream> causes transform() to not compile with tolower()
"davidg@flash.net" <gcc-bugzilla@gcc.gnu.org> writes:
| At 01:40 PM 6/6/2003 +0000, you wrote:
|
| >| string lcase (const string & s)
| >| {
| >| string result = s;
| >| transform (result.begin(), result.end(), result.begin(), tolower);
| >
| >This is a known issue. See the FAQ and a recent talk of mine and
| >Benjamin's at the recent ACCU conference.
|
| Where might I find this FAQ?
http://linux-rep.fnal.gov/software/gcc/onlinedocs/libstdc++/22_locale/howto.html#7
| I have looked on
| accu.org and accuconference.com to no avail.
A summary of the talk may be found here
http://www.accuconference.co.uk/speakers2003.asp#Gabriel Dos Reis
The set of slides is available at
http://www.cmla.ens-cachan.fr/~dosreis/C++/talks/type-of-toupper.pdf
| Could you please comment more on why this code compiles and executes just
| fine as long as I do NOT include <iostream>.
All I can say is already contained in the FAQ and the set of slides.
| The *inconsistent* handling of
| this code by g++ does seem to be a bug (at least a gnat anyway).
It is not a compiler or library bug. The only bug is in your program.
| Also, this broken code was taken directly from a very well known STL
| book...
Unfortunately, being well known does not imply being correct.
| Should I just chalk this up to a "tightening" of the g++ compiler
| per the evolving C++ standard?
|
| I guess my "work-around" will be to put a wrapper around tolower()? Is
| there any discussion in the standards world about adding template
| compatible tolower/toupper objects? Just curious.
See the FAQ and the set of slides.
-- Gaby