I just noticed I have the following in boost/python/object/forward.hpp: // Very much like boost::reference_wrapper<T>, except that in this // case T can be a reference already without causing a // reference-to-reference error. template <class T> struct reference_to_value { typedef typename add_reference<typename add_const<T>::type>::type reference;
reference_to_value(reference x) : m_value(x) {} operator reference() const { return m_value; } private: reference m_value; }; It strikes me that I might be able to replace this with reference_wrapper if it just did the same little add_reference<T> trick itself (I can handle the const externally). If you look further down in that file you'll see there's now logic for unwrapping something which might either be reference_wrapper _or_ reference_to_value, so it could be a major win. Any thoughts/objections/whatever? -Dave -- David Abrahams [EMAIL PROTECTED] * http://www.boost-consulting.com Boost support, enhancements, training, and commercial distribution _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost