Boost logo

Boost :

Subject: Re: [boost] [config] explicit call of operator templates / msvc bugworkaround
From: John Maddock (boost.regex_at_[hidden])
Date: 2012-10-10 13:20:09


>> 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()();
>> };
>>
>> template<class F>
>> void g(F f){
>> f.template operator()<int>(); //(1) works with GCC and comeau
>> f.operator()<int>(); //(2) works with MSVC
>> }
>>
>> this apparently only applies to operator calls. MSVC accepts both (1)
>> and (2) for regular functions.
>>
>> (instantiating the operator template with an object of type T as
>> argument, like mpl::for_each does, is not an option. I can't construct
>> T.)
>
> I know this is old, but I'd really like to see the right macro defect be
> added to Boost.Config.
>
> Contrary to other comments of the thread, I think this is a core defect,
> and not just a corner case. The use case is also valid, and superior to
> the alternatives for a number of reasons.

Can you provide a patch?

John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk