Boost logo

Boost :

From: Stjepan Rajko (stipe_at_[hidden])
Date: 2007-07-12 15:48:48

On 7/12/07, Peter Dimov <pdimov_at_[hidden]> wrote:
> Stjepan Rajko wrote:
> > On 7/12/07, Tobias Schwinger <tschwinger_at_[hidden]> wrote:
> >> It's wrong to have the signature for result_of contain references:
> >>
> >> The result_of specification says the parameter types in the signature
> >> type should be interpreted as types of L-Value arguments used in a
> >> call expression (cited from memory).
> >>
> >
> > Hmm - yes, the proposal says:
> >
> > "given types F, T1, T2, ..., TN and lvalues f, t1, t2, ..., tN of
> > those types, respectively, the type expression
> >
> > result_of<F(T1, T2, ..., TN)>::type
> >
> > evaluates to the type of the expression f(t1, t2, ..., tN)."
> This was once true but is no longer. The final version of the result_of
> wording says that t1 is an lvalue when T1 is a reference, an rvalue
> otherwise.

[comes to a screeching halt from changing code]

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 result<F(int)>?)

Sorry if these are silly questions, like I said I'm not 100% sure on
what exactly this wording would mean, and I want to make sure I am
doing the right thing.

Thanks in advance,


Boost list run by bdawes at, gregod at, cpdaniel at, john at