Boost logo

Boost Users :

Subject: [Boost-users] What result_type ? And why?
From: John M. Dlugosz (mpbecey7gu_at_[hidden])
Date: 2011-07-19 02:16:11


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.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net