Re: [Mingw-w64-public] toUpper()

2015-07-01 Thread papa
- From: Martin Sebor Sent: Wednesday, July 1, 2015 11:17 AM To: p...@arbolone.ca ; Riot ; mingw-w64-public@lists.sourceforge.net Cc: gcc-help Mailing List Subject: Re: [Mingw-w64-public] toUpper() On 07/01/2015 06:02 AM, p...@arbolone.ca wrote: std::wstring source(LHello World); std::wstring

Re: [Mingw-w64-public] toUpper()

2015-07-01 Thread Jonathan Wakely
On 30 June 2015 at 23:58, p...@arbolone.ca wrote: I would like to write a function to capitalize letters, say... std::wstring toUpper(const std::wstring wstr){ for ( auto it = wstr.begin(); it != wstr.end(); ++it){ global_wapstr.append(std::towupper(it)); } } This doesn’t work,

Re: [Mingw-w64-public] toUpper()

2015-07-01 Thread papa
would be very much appreciated -Original Message- From: Martin Sebor Sent: Tuesday, June 30, 2015 10:01 PM To: Riot ; mingw-w64-public@lists.sourceforge.net Cc: gcc-help Mailing List Subject: Re: [Mingw-w64-public] toUpper() On 06/30/2015 05:24 PM, Riot wrote: #include algorithm

Re: [Mingw-w64-public] toUpper()

2015-07-01 Thread Martin Sebor
To: Riot ; mingw-w64-public@lists.sourceforge.net Cc: gcc-help Mailing List Subject: Re: [Mingw-w64-public] toUpper() On 06/30/2015 05:24 PM, Riot wrote: #include algorithm #include string std::string str = Hello World; std::transform(str.begin(), str.end(), str.begin(), std

Re: [Mingw-w64-public] toUpper()

2015-07-01 Thread Martin Sebor
On 06/30/2015 05:24 PM, Riot wrote: #include algorithm #include string std::string str = Hello World; std::transform(str.begin(), str.end(), str.begin(), std::toupper); Please note this code is subtly incorrect for two reasons. There are two overloads of std::toupper: 1)

Re: [Mingw-w64-public] toUpper()

2015-07-01 Thread papa
This one is way cooler http://www.bing.com/search?q=touppersrc=IE-TopResultFORM=IETR02conversationid= From: Alexandre Pereira Nunes Sent: Tuesday, June 30, 2015 7:37 PM To: mingw-w64-public@lists.sourceforge.net Subject: Re: [Mingw-w64-public] toUpper() [cut] This may also help in future

[Mingw-w64-public] toUpper()

2015-06-30 Thread papa
I would like to write a function to capitalize letters, say... std::wstring toUpper(const std::wstring wstr){ for ( auto it = wstr.begin(); it != wstr.end(); ++it){ global_wapstr.append(std::towupper(it)); } } This doesn’t work, but doesn’t the standard already have something like

Re: [Mingw-w64-public] toUpper()

2015-06-30 Thread Riot
#include algorithm #include string std::string str = Hello World; std::transform(str.begin(), str.end(), str.begin(), std::toupper); See also: http://www.cplusplus.com/reference/locale/toupper/ This may also help in future: http://lmgtfy.com/?q=c%2B%2B+toupper -Riot On 30

Re: [Mingw-w64-public] toUpper()

2015-06-30 Thread Alexandre Pereira Nunes
[cut] This may also help in future: http://lmgtfy.com/?q=c%2B%2B+toupper ROTFL! I didn't know that one. As for std::toupper, IIRC there's an override which takes a locale argument. But I'm not sure mingw-w64 support locales other than C in that case. Last time I checked libstdc++ didn't