Boost logo

Boost :

Subject: Re: [boost] [config] explicit call of operator templates / msvc bug workaround
From: Stefan Strasser (strasser_at_[hidden])
Date: 2010-05-29 15:16:28


Zitat von Andrey Semashev <andrey.semashev_at_[hidden]>:

> On 29.05.2010 21:38, Stefan Strasser wrote:
>> Hi,
>>
>> 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?
>
> BOOST_NESTED_TEMPLATE?
>
> FWIW, why not always follow the standard syntax (that is, with the
> 'template' keyword)? This macro was introduced for some ancient
> compilers that didn't support the standard syntax.

I was a bit unclear above, MSVC requires the "template" keyword NOT to
be used when calling an operator template:

f.operator()<int>(); //MSVC:ok std:error
f.template operator()<int>(); //MSVC:error std:ok

f.func()<int>(); //MSVC:ok std:error
f.template func<int>(); //MSVC:ok std:ok

msvc 9.0


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