On Thu, 2007-08-30 at 10:05 +1000, Jonathan Adamczewski wrote: > I don't have gcc-4.2 handy - does changing this to a const reference > solve the problem? i.e > > template<typename Op> > void foo(const Op& op) { op(); }
Thanks for the suggestion, it doesn't help: test.cpp: In member function 'void My::test()': test.cpp:12: error: invalid initialization of non-const reference of type 'void (&)()' from a temporary of type 'void ()()' test.cpp:4: error: in passing argument 1 of 'void foo(const Op&) [with Op = void ()()]' -- Daniel Drake Brontes Technologies, A 3M Company http://www.brontes3d.com/opensource