
19 Jul
2011
19 Jul
'11
6:16 a.m.
I wrote the following functor: struct ASCII_lower { template< typename CharT > CharT operator() (const CharT& ch) const { if (ch >= 'A' && ch <= 'Z') return ch+0x20; return ch; // unchanged } }; and when I used it to create a transformed_range, I get an error that it doesn't find result_type in ASCII_lower. Since the return type depends on the argument, how could I declare a result_type? And why do I need it? Lambda functions don't have it, and I thought it was fairly old fashioned and optional for helping figure out the result type if necessary.