
21 Jul
2006
21 Jul
'06
9:46 a.m.
Oleg Abrosimov wrote:
Hello!
In order to obtain a polymorphic behavior with boost::variant and keep a reference semantic in corresponding visitor I've added the following constructor to boost::reference_wrapper class:
template<typename T1> reference_wrapper(reference_wrapper<T1> const& rw): t_(rw.get_pointer()) {}
This makes sense, but...
it can be tested with:
int i = 1; boost::reference_wrapper<double> = boost::ref(i);
... this doesn't; why should a reference to int be convertible to a reference to double?