Boost logo

Boost :

From: Bulygin, Sergey (Bulygin_at_[hidden])
Date: 2006-02-15 04:03:22


Dear Arkadiy,

My implementation of result_of heavily relies on BOOST_LVALUE_TYPEOF.
Is it a big problem just to let it stay in the library?
Even being not documented in public interface.

Best Regards,
Sergey Bulygin

"Arkadiy Vertleyb" <vertleyb_at_[hidden]> wrote in message news:<dstku0$2ic$1_at_[hidden]>...
> 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
>
>
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>


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