Boost logo

Boost :

Subject: [boost] [geometry] MSVC needs namespace even if it is hoisted
From: Barend Gehrels (barend_at_[hidden])
Date: 2011-12-24 07:50:33


We got a strange MSVC compilation problem in a Unit Test for
Boost.Geometry. Attached a miminal reproduction.

The essention is that we have stated:

using strategy::distance::services::returning_type;

and somewhere after that:

typedef typename returning_type<strategy_type>::type the_return_type;

but this is not accepted, in this case, by MSVC. It is well accepted by
gcc, clang and comeau. If the namespace is specified, it is accepted by

The error message is:
reproduce_msvc_using_bug.cpp(257): error C2059: syntax error : '<'

And that is the same message as if the returning_type would not be a

If we state:
std::cout << typeid(returning_type).name() << std::endl;

It compiles in MSVC, but it should not compile, because it is a
template. So somehow it picks up this "returning_type" as if it is not a
template. But of course it is.

I've tried another (much smaller) minimal reproduction to mimic this
problem but that is compiled normally by MSVC. So attached this one with
(reworked) pieces from Boost.Geometry and even Boost, but still all
contained in one file.

We've discussed this internally and the current thought is that it is a
compiler problem. If so, is this issue known to anyone on this list, or
Microsoft? Otherwise I will report it. If not so, what is the problem here?

It is of course easy to work around: giving the full namespace is OK for
any compiler. So this is more out of curiosity: what is wrong here?

Regards, Barend

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