Boost logo

Boost :

Subject: Re: [boost] [config] explicit call of operator templates / msvc bug workaround
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-05-29 16:51:55


Stefan Strasser wrote:
> Zitat von Steven Watanabe <watanabesj_at_[hidden]>:
>> 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

Boost list run by bdawes at, gregod at, cpdaniel at, john at