
Zitat von Steven Watanabe <watanabesj@gmail.com>:
Stefan Strasser wrote:
is there already a macro in Boost.Config that allows you to insert the "template" keyword in the following code for those compilers that require it?
struct functor{ template<class T> void operator()(); };
Why do you want to define this as operator(), when you can't use it as an operator? Can you deal with this the same way you would for for_each?
template<class T> struct wrap {};
struct functor { template<class T> void operator()(wrap<T>); };
I could, but the functor is a visitor that is provided by the user of this class, while the call of the operator is an implementation detail. so I'd rather use a compiler bug workaround for the call than complicate the visitor interface. operator(): because it's a functor. you could use call() or apply() instead of course, but you could for any functor. you just don't because operator() is the convention. I've already defined BOOST_OPERATOR_TEMPLATE in my code, but other compilers might have the same problem, or MSVC might fix this bug, so I'd rather use a Boost.Config macro if it exists. does it?