
Please don't top post.
Yepp - already found out and hated me for that (if there would be any edit buttons..), so - sorry for that.
This works for me and I think it is what you are after. Am I missing something? (btw ... notice that the int in the function sig is by value ... not reference)
--------------------------------
#include <iostream> #include
#include void my_func( boost::function< void(int) > func ) { for( int i=0; i<5; ++i ) { func( i ); } }
int main() { using boost::phoenix::arg_names::arg1;
my_func( (std::cout << arg1 << '\n') );
return 0; }
This is very interesting, since exactly this code won't compile with my setup (error message looks very close to the one I supplied in my second post): g++ (GCC) 4.4.2 BOOST_VERSION 103900 BOOST_PHOENIX_VERSION 0x2000 // 2.0.0