Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2005-02-09 23:33:32


 I reviewed the serialization/variant.hpp. My reaction is:

a) Its pretty hard to understand.
b) I like it.
c) It seems to satisfy all the requirements we wanted.
d) I ran the test on my VC 7.1 system and it worked fine
e) I made a few cosmetic changes - just to make it look like the rest of
serialization code and checked it into CVS

Since I made these changes you should check the versions in the main CVS if
you want to match up the line numbers.

There's still work to be done however - welcome to boost

Here is what I get when I try to compile with gcc 3.3:

test_variant.cpp
Linking to lib file: libboost_serialization-vc6-mt-gd-1_32.lib
C:\BoostMainCVS\boost/serialization/variant.hpp(118) : error C2780: 'class
boost::_bi::bind_t<R,class boost::_mfi::dm<R,T>,class
boost::_bi::list1<class boost::_bi::value<R> > > __cdecl boost::bind(R
T::*,A1)' : expects 2 arguments - 3 provided
        C:\BoostMainCVS\boost/bind.hpp(1501) : see declaration of 'bind'
        C:\BoostMainCVS\boost/serialization/split_free.hpp(44) : see
reference to function template instantiation 'void __cdecl
boost::serialization::save(class boost::archive::binary_oarchive &,const
class boost::variant<bool,float,int,class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >,struct
boost::detail::variant::void4,struct boost::detail::variant::void5,struct
boost::detail::variant::void6,struct boost::detail::variant::void7,struct
boost::detail::variant::void8,struct boost::detail::variant::void9,struct
boost::detail::variant::void10,struct boost::detail::variant::void11,struct
boost::detail::variant::void12,struct boost::detail::variant::void13,struct
boost::detail::variant::void14,struct boost::detail::variant::void15,struct
boost::detail::variant::void16,struct boost::detail::variant::void17,struct
boost::detail::variant::void18,struct boost::detail::variant::void19>
&,unsigned int)' being compiled
C:\BoostMainCVS\boost/serialization/variant.hpp(118) : error C2780: 'class
boost::_bi::bind_t<R,struct
boost::_mfi::cmf8<R,T,B1,B2,B3,B4,B5,B6,B7,B8>,class boost::_bi::list9<class
boost::_bi::value<R>,class boost::_bi::value<R>,class
boost::_bi::value<R>,class boost::_bi::value<R>,class
boost::_bi::value<R>,class boost::_bi::value<R>,class
boost::_bi::value<R>,class boost::_bi::value<R>,class boost::_bi::value<R> >
> __cdecl boost::bind(R (__thiscall T::*)(B1,B2,B3,B4,B5,B6,B7,B8)
const,A1,A2,A3,A4,A5,A6,A7,A8,A9)' : expects 10 arguments - 3 provided
        C:\BoostMainCVS\boost/bind/bind_mf_cc.hpp(222) : see declaration of
'bind'
        C:\BoostMainCVS\boost/serialization/split_free.hpp(44) : see
reference to function template instantiation 'void __cdecl
boost::serialization::save(class boost::archive::binary_oarchive &,const
class boost::variant<bool,float,int,class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >,struct
boost::detail::variant::void4,struct boost::detail::variant::void5,struct
boost::detail::variant::void6,struct boost::detail::variant::void7,struct
boost::detail::variant::void8,struct boost::detail::variant::void9,struct
boost::detail::variant::void10,struct boost::detail::variant::void11,struct
boost::detail::variant::void12,struct boost::detail::variant::void13,struct
boost::detail::variant::void14,struct boost::detail::variant::void15,struct
boost::detail::variant::void16,struct boost::detail::variant::void17,struct
boost::detail::variant::void18,struct boost::detail::variant::void19>
&,unsigned int)' being compiled
C:\BoostMainCVS\boost/serialization/variant.hpp(118) : error C2780: 'class
boost::_bi::bind_t<R,struct
boost::_mfi::mf8<R,T,B1,B2,B3,B4,B5,B6,B7,B8>,class boost::_bi::list9<class
boost::_bi::value<R>,class boost::_bi::value<R>,class
boost::_bi::value<R>,class boost::_bi::value<R>,class
boost::_bi::value<R>,class boost::_bi::value<R>,class
boost::_bi::value<R>,class boost::_bi::value<R>,class boost::_bi::value<R> >
> __cdecl boost::bind(R (__thiscall
T::*)(B1,B2,B3,B4,B5,B6,B7,B8),A1,A2,A3,A4,A5,A6,A7,A8,A9)' : expects 10
arguments - 3 provided
        C:\BoostMainCVS\boost/bind/bind_mf_cc.hpp(211) : see declaration of
'bind'
        C:\BoostMainCVS\boost/serialization/split_free.hpp(44) : see
reference to function template instantiation 'void __cdecl
boost::serialization::save(class boost::archive::binary_oarchive &,const
class boost::variant<bool,float,int,class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >,struct
boost::detail::variant::void4,struct boost::detail::variant::void5,struct
boost::detail::variant::void6,struct boost::detail::variant::void7,struct
boost::detail::variant::void8,struct boost::detail::variant::void9,struct
boost::detail::variant::void10,struct boost::detail::variant::void11,struct
boost::detail::variant::void12,struct boost::detail::variant::void13,struct
boost::detail::variant::void14,struct boost::detail::variant::void15,struct
boost::detail::variant::void16,struct boost::detail::variant::void17,struct
boost::detail::variant::void18,struct boost::detail::variant::void19>
&,unsigned int)' being compiled
C:\BoostMainCVS\boost/serialization/variant.hpp(118) : error C2780: 'class
boost::_bi::bind_t<R,struct
boost::_mfi::cmf7<R,T,B1,B2,B3,B4,B5,B6,B7>,class boost::_bi::list8<class
boost::_bi::value<R>,class boost::_bi::value<R>,class
boost::_bi::value<R>,class boost::_bi::value<R>,class
boost::_bi::value<R>,class boost::_bi::value<R>,class
boost::_bi::value<R>,class boost::_bi::value<R> > > __cdecl boost::bind(R
(__thiscall T::*)(B1,B2,B3,B4,B5,B6,B7) const,A1,A2,A3,A4,A5,A6,A7,A8)' :
expects 9 arguments - 3 provided
        C:\BoostMainCVS\boost/bind/bind_mf_cc.hpp(198) : see declaration of
'bind'
        C:\BoostMainCVS\boost/serialization/split_free.hpp(44) : see
reference to function template instantiation 'void __cdecl
boost::serialization::save(class boost::archive::binary_oarchive &,const
class boost::variant<bool,float,int,class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >,struct
boost::detail::variant::void4,struct boost::detail::variant::void5,struct
boost::detail::variant::void6,struct boost::detail::variant::void7,struct
boost::detail::variant::void8,struct boost::detail::variant::void9,struct
boost::detail::variant::void10,struct boost::detail::variant::void11,struct
boost::detail::variant::void12,struct boost::detail::variant::void13,struct
boost::detail::variant::void14,struct boost::detail::variant::void15,struct
boost::detail::variant::void16,struct boost::detail::variant::void17,struct
boost::detail::variant::void18,struct boost::detail::variant::void19>
&,unsigned int)' being compiled
C:\BoostMainCVS\boost/serialization/variant.hpp(118) : error C2780: 'class
boost::_bi::bind_t<R,struct boost::_mfi::mf7<R,T,B1,B2,B3,B4,B5,B6,B7>,class
boost::_bi::list8<class boost::_bi::value<R>,class
boost::_bi::value<R>,class boost::_bi::value<R>,class
boost::_bi::value<R>,class boost::_bi::value<R>,class
boost::_bi::value<R>,class boost::_bi::value<R>,class boost::_bi::value<R> >
> __cdecl boost::bind(R (__thiscall
T::*)(B1,B2,B3,B4,B5,B6,B7),A1,A2,A3,A4,A5,A6,A7,A8)' : expects 9
arguments - 3 provided
        C:\BoostMainCVS\boost/bind/bind_mf_cc.hpp(187) : see declaration of
'bind'
        C:\BoostMainCVS\boost/serialization/split_free.hpp(44) : see
reference to function template instantiation 'void __cdecl
boost::serialization::save(class boost::archive::binary_oarchive &,const
class boost::variant<bool,float,int,class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >,struct
boost::detail::variant::void4,struct boost::detail::variant::void5,struct
boost::detail::variant::void6,struct boost::detail::variant::void7,struct
boost::detail::variant::void8,struct boost::detail::variant::void9,struct
boost::detail::variant::void10,struct boost::detail::variant::void11,struct
boost::detail::variant::void12,struct boost::detail::variant::void13,struct
boost::detail::variant::void14,struct boost::detail::variant::void15,struct
boost::detail::variant::void16,struct boost::detail::variant::void17,struct
boost::detail::variant::void18,struct boost::detail::variant::void19>
&,unsigned int)' being compiled
C:\BoostMainCVS\boost/serialization/variant.hpp(118) : error C2780: 'class
boost::_bi::bind_t<R,struct boost::_mfi::cmf6<R,T,B1,B2,B3,B4,B5,B6>,class
boost::_bi::list7<class boost::_bi::value<R>,class
boost::_bi::value<R>,class boost::_bi::value<R>,class
boost::_bi::value<R>,class boost::_bi::value<R>,class
boost::_bi::value<R>,class boost::_bi::value<R> > > __cdecl boost::bind(R
(__thiscall T::*)(B1,B2,B3,B4,B5,B6) const,A1,A2,A3,A4,A5,A6,A7)' : expects
8 arguments - 3 provided
        C:\BoostMainCVS\boost/bind/bind_mf_cc.hpp(174) : see declaration of
'bind'
        C:\BoostMainCVS\boost/serialization/split_free.hpp(44) : see
reference to function template instantiation 'void __cdecl
boost::serialization::save(class boost::archive::binary_oarchive &,const
class boost::variant<bool,float,int,class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >,struct
boost::detail::variant::void4,struct boost::detail::variant::void5,struct
boost::detail::variant::void6,struct boost::detail::variant::void7,struct
boost::detail::variant::void8,struct boost::detail::variant::void9,struct
boost::detail::variant::void10,struct boost::detail::variant::void11,struct
boost::detail::variant::void12,struct boost::detail::variant::void13,struct
boost::detail::variant::void14,struct boost::detail::variant::void15,struct
boost::detail::variant::void16,struct boost::detail::variant::void17,struct
boost::detail::variant::void18,struct boost::detail::variant::void19>
&,unsigned int)' being compiled
C:\BoostMainCVS\boost/serialization/variant.hpp(118) : error C2780: 'class
boost::_bi::bind_t<R,struct boost::_mfi::mf6<R,T,B1,B2,B3,B4,B5,B6>,class
boost::_bi::list7<class boost::_bi::value<R>,class
boost::_bi::value<R>,class...

Here is what I get when I try to compile with VC 8.0:

 Run output:../../../libs/serialization/test/test_variant.cpp(58): error in
"call_test_main": test gets_written == got_read failed [6.4 != 6.4]

*** 1 failure detected in test case "call_test_main"

EXIT STATUS: 201

Borland also gives compile errors:

Error E2401 C:\BoostMainCVS\boost/variant/detail/substitute_fwd.hpp 50:
Invalid template argument list
Error E2041 C:\BoostMainCVS\boost/variant/detail/substitute_fwd.hpp 50:
Incorrect use of default
Error E2040 C:\BoostMainCVS\boost/variant/detail/substitute_fwd.hpp 50:
Declaration terminated incorrectly
Error E2394 C:\BoostMainCVS\boost/variant/detail/substitute.hpp 101: Too few
arguments passed to template 'substitute<T,Dest,Source,Arity>'
Error E2040 C:\BoostMainCVS\boost/variant/detail/substitute.hpp 101:
Declaration terminated incorrectly
Error E2228 C:\BoostMainCVS\boost/variant/detail/substitute.hpp 101: Too
many error or warning messages

Robert Ramey


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