Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-04-07 13:06:39


Eric Niebler:
> Peter Dimov wrote:
>> Eric Niebler:
>>
>>> // lvalue
>>> result_of<identity(int &)>::type l = identity()(i);
>>> assert( &l == &i );
>>
>> Does this really compile for you?
>
> Yes.

...

> template<typename Arg>
> Arg &operator()(Arg &arg) const
> {
> return arg;
> }

With this addition it does. I overlooked the

>>>> // and a non-const overload, too

part in your original. I'm becoming too compiler-like.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk