Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2004-11-24 08:58:30


Rodrigo de Salvo Braz <braz_at_[hidden]> writes:

> On Mon, 22 Nov 2004, David Abrahams wrote:
>
>> Because often the result type depends on the argument type that is
>> actually passed:
>>
>> (_1 + 3)(4)
>>
>> vs.
>>
>> (_1 + 3)(static_cast<char const*>("hello"))
>
> But isn't it the case that any instantiated functor object will have a
> well-defined result_type? In your examples it seems '(_1 + 3)' would be
> instantiated to different types.

The expression

    _1 + 3

is a function object by itself, and that's what you pass to the
algorithm.

> Anyway, I guess a better solution to my particular problem would be for
> make_transform_iterator to be able to receive a result type and make an
> adaptable functor out of any UnaryFunction, right?

Yes. Patches welcome.

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

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