
4 Apr
2007
4 Apr
'07
9:33 p.m.
Barchenkov, Alexei (IT) wrote:
Rewording from a previous post:
Are there any issues with binding a boost:ref to a free templated function? On gcc32 this generates an error:
class Test { };
template <class T> void foo(T arg_) { }
int main(int) { Test t; boost::reference_wrapper<Test> tr(t); boost::function<void()> fun1 = boost::bind(&::foo<boost::reference_wrapper<Test> >, tr); }
The problem is that tr is ref( t ) and is interpreted by bind as a request to store a reference to t. boost::bind( &foo< Test& >, tr ) should work, if this helps.