
15 Sep
2004
15 Sep
'04
7:37 p.m.
Daniel Wallin wrote:
Neal D. Becker wrote:
This handy little item, lvalue_cast, would make a useful addition to boost. I didn't write it, and I don't recall who did.
template<class T> inline T& lvalue_cast (const T& rvalue) { return const_cast<T&> (rvalue); }
I wrote something like this, that has the upshot of being safe. ;)
The trick would be to get it to return a const lvalue when you pass a const rvalue ;-) -- Dave Abrahams Boost Consulting http://www.boost-consulting.com