Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"is_assignable"error when using Boost 1.68 / LLVM / VS2017

I receive the following build error when switching to LLVM toolset in VS2017 to build code using Boost 1.68. The code builds fine with MSVC compiler. 1>C:\boost_1_68_0\boost/type_traits/has_trivial_move_assign.hpp(49): error : no template named 'is_assignable'; did you mean 'std::is_assignable'? 1>C:\boost_1_68_0\boost/type_traits/intrinsics.hpp(233): note: expanded from macro 'BOOST_HAS_TRIVIAL_MOVE_ASSIGN'

like image 247
oracle3001 Avatar asked Sep 19 '18 18:09

oracle3001


1 Answers

I think your problem here may be __clang vs. __clang__ to ID the compiler. Clang has different predefined macros depending on what front end is used. Because of this confusion, you boost may fail to include the header boost/type_traits/is_assignable.hpp which defines the is_assignable that you are missing. Try this: In boost/type_traits/has_trivial_move_assign.hpp add || defined(__clang__) the line that tests for clang

#if defined(__GNUC__) || defined(__clang)
#include <boost/type_traits/is_assignable.hpp>

to make:

#if defined(__GNUC__) || defined(__clang) || defined(__clang__) 
#include <boost/type_traits/is_assignable.hpp>

Boost should then include is_assignable.hpp and build.

like image 139
Christopher Ian Stern Avatar answered Oct 17 '22 04:10

Christopher Ian Stern