Boost logo

Boost :

Subject: Re: [boost] [move] move assignment from lvalue returned by func (was: one more dumb question)
From: DE (satan66613_at_[hidden])
Date: 2010-02-26 15:11:55


on 26.02.2010 at 21:27
 Jeffrey Hellrung wrote :
> Yes, the type of an rvalue can be const-qualified, but the current
> mechanism cannot distinguish between a const-qualified rvalue and a
> const-qualified lvalue. So only returning by non-const value will work.

> For a simple demonstration of the basic mechanism (untested, so not sure
> if it will compile, but it should give the basic idea)
> [code here]
oh now i get it! i didn't realize there are operator rv<T>& and its
const counterpart hidden behind the macros
thanks for your effort explaining this

> I don't have any simpler solutions, only a spectrum of solutions to
> select the best set of tradeoffs for a given situation. Which, in some
> sense, is more complicated.
so summing it all up i say that this solution is far too tricky to be
useful
no offence
it seems to me too restrictive and too incomplete
the infrastructure is too complicated
on the other hand i guess forcing users to return something like rv<t>
from functions like this

  rv<my_type> foo();

is not an option

another question arises: who is the target audience (aka users) of
this lib?

-- 
Pavel

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