Boost logo

Boost :

Subject: [boost] [variant] 1.58 boost/variant/get.hpp compile errors
From: Maarten de Vries (maarten_at_[hidden])
Date: 2015-05-04 09:12:20


Hello list,

I recently updated to boost 1.58 and one of my programs didn't compile any
more. The reason was the <boost/variant/get.hpp> header. A simple test
program and compiler output is attached below. Swapping the order of the
includes or including <boost/type_traits/remove_cv.hpp> before
<boost/variant/get.hpp> in the test program will get rid of the errors. It
would appear that <boost/variant/detail/element_index.hpp> should include
<boost/type_traits/remove_cv.hpp>.

Kind regards,
Maarten de Vries

Test program:

#include <boost/variant/get.hpp>
> #include <boost/variant/variant.hpp>
>
> int main() {
> return 0;
> }
>

Compiler output g++ (GCC) 4.9.2 20150304 (prerelease):

In file included from /usr/include/boost/variant/get.hpp:24:0,
> from test.cpp:1:
> /usr/include/boost/variant/detail/element_index.hpp:38:69: error:
> ‘remove_cv’ in namespace ‘boost’ does not name a template type
> variant_element_functor<boost::mpl::_1, typename
> boost::remove_cv<T>::type >
> ^
> /usr/include/boost/variant/detail/element_index.hpp:38:78: error: expected
> template-argument before ‘<’ token
> variant_element_functor<boost::mpl::_1, typename
> boost::remove_cv<T>::type >
>
> ^
> /usr/include/boost/variant/detail/element_index.hpp:38:78: error: expected
> ‘>’ before ‘<’ token
> /usr/include/boost/variant/detail/element_index.hpp:38:88: error: template
> argument 2 is invalid
> variant_element_functor<boost::mpl::_1, typename
> boost::remove_cv<T>::type >
>
> ^
> /usr/include/boost/variant/detail/element_index.hpp:39:9: error: expected
> ‘::’ before ‘>’ token
> >
> ^
> /usr/include/boost/variant/detail/element_index.hpp:39:9: error: expected
> identifier before ‘>’ token
> /usr/include/boost/variant/detail/element_index.hpp:39:9: error: template
> argument 2 is invalid
> /usr/include/boost/variant/detail/element_index.hpp:40:5: error: expected
> ‘::’ before ‘>’ token
> >
> ^
> /usr/include/boost/variant/detail/element_index.hpp:40:5: error: expected
> identifier before ‘>’ token
> /usr/include/boost/variant/detail/element_index.hpp:40:5: error: template
> argument 2 is invalid
> /usr/include/boost/variant/detail/element_index.hpp:41:1: error: expected
> ‘::’ before ‘{’ token
> {};
> ^
> /usr/include/boost/variant/detail/element_index.hpp:41:1: error: expected
> class-name before ‘{’ token
>


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