
4 Jan
2002
4 Jan
'02
1:38 a.m.
Is there a syntax for making boost::bind bind to functions that are templates? Here is an (extremally simplified) example that doesnt compile: #include <boost/bind.hpp> template < class Function > void f( Function func ) { func( 46 ); } void g( int num ) { num++; } int main( void ) { boost::bind( f, g )(); boost::bind( f, _1 )( g ); return 0; } The two bind lines in main both get an error "call of non-function". Is there a way to make this work? ..Duane p.s. CodeWarrior 7 on a Macintosh (OS X)