#include #include template struct dummy_func { typedef int result_type; template int operator()(A1 const&, A2 const&) { return 0; } }; struct foo; template struct bar { typedef typename bab::dub bam; }; int main() { boost::fusion::vector<> vec; boost::fusion::list<> list; //works fine fold(vec,0,dummy_func()); //does not work /* 1>main.cpp(22) : error C2027: use of undefined type 'foo' 1> main.cpp(17) : see declaration of 'foo' 1> main.cpp(46) : see reference to class template instantiation 'bar' being compiled 1> with 1> [ 1> bab=foo 1> ] 1>main.cpp(22) : error C2146: syntax error : missing ';' before identifier 'bam' 1>main.cpp(22) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>main.cpp(22) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int */ fold(vec,0,dummy_func >()); //works fine dummy_func > t; //does not work fold(vec,0,t); //works fine boost::fusion::detail::fold(vec,0,dummy_func(),boost::fusion::random_access_traversal_tag()); //works fine boost::fusion::detail::fold(vec,0,dummy_func >(),boost::fusion::random_access_traversal_tag()); //works fine fold(list,0,dummy_func()); //does not work fold(list,0,dummy_func >()); }