Boost logo

Boost :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2006-02-14 17:17:36


Hi.

It turned out that we can't provide the portable implementation of
LVALUE_TYPEOF that would be both safe and useful.

The primary purpose of this feature would be to assist in creation of
wrapper functions (possibly through the result_of). The current
implementation cannot distinguish between const rvalues and lvalues, and so
yields const T& instead of const T (on VC7.1+, for UDT, it's also volatile&
instead of volatile, and volatile const& instead of volatile const). If
used in a wrapper function, this would lead to a dangling reference.

An alternative would be to yield rvalue for anything other than T&, but this
would not work with const T& where T is non-copyable (again, on MS for
UDT -- also with volatile [const] T&).

There are some (non-portable) ways to do better, but those work only for vc
and gcc. Returning different results on different compilers would make it
useless for generic code which is the primary target of this feature.

I am pretty sure nobody depends on LVALUE_TYPEOF in 1.34...

So, unless there are some serious objections, we are not including
LVALUE_TYPEOF into 1.34. If, at some point in the future, a better way is
found to determine lvalueness, this feature can be added again.

Regards,
Arkadiy


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