
AMDG Stefan Strasser wrote:
Zitat von Steven Watanabe <watanabesj@gmail.com>:
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.
It isn't a functor if you need explicit template arguments.
you could use call() or apply() instead of course, but you could for any functor. you just don't because operator() is the convention.
In Christ, Steven Watanabe