#include #include //#include //#include #include int i=0; int a[] = {0}; template inline void foo( UnaryFunction fun ) { fun(i); } int main() { namespace bp = boost::phoenix; using namespace boost::phoenix::arg_names; (bp::ref(a)[arg1]++)(i); assert( a[0]==1 ); foo( bp::ref(a)[arg1]++ ); assert( a[0]==2 ); }