From: Peter Dimov (pdimov_at_[hidden])
Date: 2007-07-13 08:02:23
Tobias Schwinger wrote:
> Peter Dimov wrote:
>> Stjepan Rajko wrote:
>>> [comes to a screeching halt from changing code]
>> Yep. :-)
> Sorry for the false alarm!
>>> I'm still not entirely on very sure footing when it comes to rvalues
>>> and lvalues, so can I bother you with a practical clarification?
>>> So, if I have, say, a function object with operator()(int &), I
>>> should specify result<F(int &)>, (but maybe if I have
>>> operator()(const int &), or operator()(int), I can specify
>> If you have operator()( int& ), you need result<F(int&)>. If you have
>> operator()( int ), you need both result<F(int)> and result<F(int&)>
>> because your operator() can take either an lvalue or an rvalue.
> We'd also need 'int const &' (given we don't just provide
> 'result_type' or deduce whatever it is), right?
And bool, and char, and double, and so on; every argument type that can be
passed to operator(). It's not practical to enumerate everything. But to
answer your question, yes, a const lvalue of type int is a valid argument
and needs to be supported by your specialization/result.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk