|
Boost Users : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-07-04 13:40:37
klaus triendl wrote:
> Peter Dimov wrote:
>> Lambda sees that you are invoking operator<< on a MySubStream& and
>> deduces the return type to be MySubStream&; it isn't smart enough to
>> see that you're actually using the operator<< definition for the
>> base class MyStream.
>
> I thought that it would be converted implicitly in the end by the
> compiler..
There is no implicit conversion from MyStream& to MySubStream&.
> Can I make it smart enough?
I showed you one way. Another would be to use ret<MyStream&> to force a
specific return type:
http://www.boost.org/doc/html/lambda/le_in_details.html#lambda.overriding_deduced_return_type
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