Boost logo

Boost Users :

Subject: Re: [Boost-users] [geometry][typeof][type_traits] Using Boost with Clang/LLVM & VC14
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2016-03-15 13:20:36


Degski wrote:
> The problems arose while compiling the minimal example from the get
> started tutorial.
> Below I pasted some compiler (Clang-Cl.exe) output. It has all to do
> with MSVC compiler bugs workarounds.

The name of a macro is _MSC_VER, not __MSVC_VER. With MSC+Clang
_MSC_VER, __clang__ and BOOST_CLANG are defined after inclusion of

When I compile the Boost.Geometry Quick Start example with MSC+Clang I
only get errors in other libraries, i.e. TypeOf and TypeTraits (master
branch). I'm still going to replace _MSC_VER checks in Geometry with
BOOST_MSVC checks but this will not fix the issues you have.

Side note: If you'd like to have this platform fully supported the best
way would be to run the regression tests so the maintainers of all
liberaries would be able to see the errors. Or you could try to convince
people already running the tests on Windows to add one more compiler.


> 1>z:\vc\x64\include\boost/typeof/msvc/typeof_impl.hpp(150,31): error :
> template specialization or definition requires a template parameter
> list corresponding to the nested type 'base_type' (aka
> 'msvc_extract_type<ID>')
> 1> struct base_type::id2type // This uses nice VC6.5 and
> VC7.1 bugfeature
> 1> ~~~~~~~~~ ^
> 1>z:\vc\x64\include\boost/typeof/msvc/typeof_impl.hpp(150,20): error :
> nested name specifier for a declaration cannot depend on a template
> parameter
> 1> struct base_type::id2type // This uses nice VC6.5 and
> VC7.1 bugfeature
> 1> ^~~~~~~~~~~
This code is enabled when BOOST_MSVC is NOT defined or version is lesser
than 1300.
And the file is included if _MSC_VER is defined:

If BOOST_MSVC is checked instead then the code compiles but then
BOOST_TYPEOF_EMULATION is defined and I'm guessing this is not correct.
With Clang probably native __typeof__ should be used. So either
BOOST_CLANG/__clang__ should be checked here as a special case with
_MSC_VER or it should be checked above as a standalone case, or together
with __GNUC__. What would be prefered?


error : no template named 'is_assignable'; did you mean
1> ^
1> D:\lib\modular-boost\boost/type_traits/intrinsics.hpp(199,96) :
note: expanded from macro 'BOOST_HAS_NOTHROW_ASSIGN'
1> # define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) &&
!is_volatile<T>::value && is_assignable<T&, const T&>::value)
1> ^
1> C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\include\type_traits(577,9) : note: 'std::is_assignable'
declared here
1> struct is_assignable
1> ^

error : no template named 'is_default_constructible'; did you mean
1> template <class T> struct has_nothrow_constructor : public
integral_constant<bool, BOOST_HAS_NOTHROW_CONSTRUCTOR(T)>{};
1> ^
1> D:\lib\modular-boost\boost/type_traits/intrinsics.hpp(193,80) :
note: expanded from macro 'BOOST_HAS_NOTHROW_CONSTRUCTOR'
(__has_nothrow_constructor(T) && is_default_constructible<T>::value)
1> ^
1> C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\include\type_traits(539,9) : note:
'std::is_default_constructible' declared here
1> struct is_default_constructible
1> ^

I'm guessing that more type traits suffer from this.


P.S. In both cases you could create a pull request with proposed change
on GitHub or create a ticket:
if maintainers of those libraries didn't answer here.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at