Boost logo

Boost Users :

Subject: [Boost-users] troubles deriving from using boost variant
From: Greg Kellum (greg.kellum_at_[hidden])
Date: 2010-03-27 18:19:32


Hi all,

I have been using boost's variant library in a project, and I've noticed
that when I import the class using the variant class into other classes I
start having the strangest compilation problems. I've been dealing with
these problems for the last few months by isolating that code as much as
possible. I've put it behind a factory which returns an abstract class
which hides the fact that a variant is being used by the implementing class
at all. This keeps other classes from having to import the implementing
class and by extension the boost variant header, but it also makes it
difficult to make full use of visitors together with the variant because
creating new visitors that include the implementing class leads to these
same strange compilation problems.

I was hoping that someone might be able to give me a better diagnosis for
the underlying reason for these problems. I've included the error output
below. If anyone can give me any greater insight into what's causing these
errors, I would be extremely grateful.

Best,
Greg

1>C:\Program Files
(x86)\boost\boost_1_42\boost/mpl/aux_/integral_wrapper.hpp(80): error C2544:
expected ')' for operator '()'
1> C:\Program Files
(x86)\boost\boost_1_42\boost/mpl/aux_/integral_wrapper.hpp(81) : see
reference to class template instantiation 'boost::mpl::integral_c<T,N>'
being compiled
1>C:\Program Files
(x86)\boost\boost_1_42\boost/mpl/aux_/integral_wrapper.hpp(80): error C2146:
syntax error : missing ';' before identifier 'L'
1>C:\Program Files
(x86)\boost\boost_1_42\boost/mpl/aux_/integral_wrapper.hpp(80): error C4430:
missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files
(x86)\boost\boost_1_42\boost/mpl/aux_/integral_wrapper.hpp(80): error C2059:
syntax error : ')'
1>C:\Program Files
(x86)\boost\boost_1_42\boost/mpl/aux_/integral_wrapper.hpp(80): error C2143:
syntax error : missing ';' before 'const'
1>C:\Program Files
(x86)\boost\boost_1_42\boost/mpl/aux_/integral_wrapper.hpp(80): error C4430:
missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files
(x86)\boost\boost_1_42\boost/mpl/aux_/integral_wrapper.hpp(80): error C4430:
missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files
(x86)\boost\boost_1_42\boost/mpl/aux_/integral_wrapper.hpp(80): error C2059:
syntax error : '{'
1>C:\Program Files
(x86)\boost\boost_1_42\boost/mpl/aux_/integral_wrapper.hpp(80): error C2334:
unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files
(x86)\boost\boost_1_42\boost/mpl/aux_/integral_wrapper.hpp(80): error C2544:
expected ')' for operator '()'
1> C:\Program Files
(x86)\boost\boost_1_42\boost/type_traits/integral_constant.hpp(21) : see
reference to class template instantiation 'boost::mpl::integral_c<T,N>'
being compiled
1> with
1> [
1> T=size_t,
1> N=0
1> ]
1> C:\Program Files
(x86)\boost\boost_1_42\boost/type_traits/alignment_of.hpp(109) : see
reference to class template instantiation 'boost::integral_constant<T,val>'
being compiled
1> with
1> [
1> T=size_t,
1> val=0
1> ]
1>C:\Program Files
(x86)\boost\boost_1_42\boost/mpl/aux_/integral_wrapper.hpp(80): error C2146:
syntax error : missing ';' before identifier 'L'
1>C:\Program Files
(x86)\boost\boost_1_42\boost/mpl/aux_/integral_wrapper.hpp(80): error C4430:
missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files
(x86)\boost\boost_1_42\boost/mpl/aux_/integral_wrapper.hpp(80): error C2059:
syntax error : ')'
1>C:\Program Files
(x86)\boost\boost_1_42\boost/mpl/aux_/integral_wrapper.hpp(80): error C2143:
syntax error : missing ';' before 'const'
1>C:\Program Files
(x86)\boost\boost_1_42\boost/mpl/aux_/integral_wrapper.hpp(80): error C4430:
missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files
(x86)\boost\boost_1_42\boost/mpl/aux_/integral_wrapper.hpp(80): error C4430:
missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files
(x86)\boost\boost_1_42\boost/mpl/aux_/integral_wrapper.hpp(80): error C2059:
syntax error : '{'
1>C:\Program Files
(x86)\boost\boost_1_42\boost/mpl/aux_/integral_wrapper.hpp(80): error C2334:
unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files
(x86)\boost\boost_1_42\boost/mpl/aux_/integral_wrapper.hpp(80): error C2544:
expected ')' for operator '()'
1> C:\Program Files
(x86)\boost\boost_1_42\boost/type_traits/integral_constant.hpp(21) : see
reference to class template instantiation 'boost::mpl::integral_c<T,N>'
being compiled
1> with
1> [
1> T=size_t,
1> N=8
1> ]
1> C:\Program Files
(x86)\boost\boost_1_42\boost/type_traits/alignment_of.hpp(89) : see
reference to class template instantiation 'boost::integral_constant<T,val>'
being compiled
1> with
1> [
1> T=size_t,
1> val=8
1> ]
1> C:\Program Files
(x86)\boost\boost_1_42\boost/type_traits/type_with_alignment.hpp(289) : see
reference to class template instantiation 'boost::alignment_of<T>' being
compiled
1> with
1> [
1> T=boost::detail::max_align
1> ]



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net