On Sunday 15 December 2002 10:58 am, David Abrahams wrote: > 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
Good idea so long as reference_wrapper stays Assignable. Is remove_reference implemented on all compilers? If so, I have no objections. Doug _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost