14 Jul
2014
14 Jul
'14
10:01 a.m.
Andrey Semashev wrote:
Would you expect this code to work:
struct my_class { void bar(); };
struct my_class_const { void bar() const; };
template< typename T > void foo(T const& t) { typedef typename boost::unwrap_reference<T>::type class_type; boost::bind(&class_type::bar, boost::ref(t))(); }
foo(my_class_const()); my_class x; foo(boost::ref(x));
Unless I'm doing something wrong, this code seems to work with the old boost::ref, it also works with the new boost::ref without the collapsing overloads. I'm not sure what your point is; are you arguing that the code must fail?