[prev in list] [next in list] [prev in thread] [next in thread] 

List:       boost-users
Subject:    Re: [Boost-users]  Re: (onlist) Using boost::lamba with a vector of
From:       "Peter Dimov" <pdimov () mmltd ! net>
Date:       2003-11-24 15:32:26
Message-ID: 01d801c3b2a0$2abee190$1d00a8c0 () pdimov2
[Download RAW message or body]

David Abrahams wrote:
> "Peter Dimov" <pdimov@mmltd.net> writes:
>
>> Hi,
>>
>> Jaakko Jarvi wrote:
>>>> The second alternative doesn't work since Lambda doesn't support
>>>> *_1 for shared_ptr.
>>>
>>> In particular, Lambda's return type deduction templates are not
>>> aware of shared_ptr.
>>
>> They do not need to be aware of shared_ptr. shared_ptr provides
>> ::element_type, for consistency with std::auto_ptr. boost::shared_ptr
also
>> has ::reference, although tr1::shared_ptr might not. You just need
>> to look for the individual typedef and not instantiate
>> iterator_traits prematurely.
>
> But what if iterator_traits is specialized?  The typedef could say the
> wrong thing.

Technically yes. We know that 100% reliable return type inference is
impossible. In practice we want it to work most of the time, and currently
the opposite is true.

Of course this would have been mostly academic if the simpler bind(&X::f,
_1) syntax worked with Lambda.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic