Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2003-11-25 21:33:11


When I compile your test program with gcc 3.2 on my windows / cygwin system
it compiles fine - just as it does on your system.

When I compile your test program with VC 7.0 I get:

c:\boost-dev\libs\serialization\test\test_zmisc.cpp(31) : error C2667: 'serialize' : none of 3 overloads have a best conversion
        c:\boost-dev\libs\serialization\test\test_zmisc.cpp(22): could be 'void serialize(Archive &,B &,const unsigned long)'
        c:\boost-dev\libs\serialization\test\test_zmisc.cpp(16): or 'void serialize(Archive &,std::map<Key,Compare,Allocator,std::allocator<std::pair<const Key,Compare>>> &,const unsigned long)'
        c:\boost-dev\libs\serialization\test\test_zmisc.cpp(9): or 'void serialize(Archive &,T &,const unsigned long)'
        while trying to match the argument list '(A, B, unsigned int)'
c:\boost-dev\libs\serialization\test\test_zmisc.cpp(31) : error C2668: 'serialize' : ambiguous call to overloaded function
        c:\boost-dev\libs\serialization\test\test_zmisc.cpp(22): could be 'void serialize(Archive &,B &,const unsigned long)'
        c:\boost-dev\libs\serialization\test\test_zmisc.cpp(16): or 'void serialize(Archive &,std::map<Key,Compare,Allocator,std::allocator<std::pair<const Key,Compare>>> &,const unsigned long)'
        c:\boost-dev\libs\serialization\test\test_zmisc.cpp(9): or 'void serialize(Archive &,T &,const unsigned long)'
        while trying to match the argument list '(A, B, unsigned int)'

So, I guess we'll leave the third paramter as a long in serialization.hpp in order
to support non-conforming compilers. My explanation in the documentation regarding
the type of the third parameter is absolutely incorrect. I will amend it accordingly.

 I'm finding it very confusing to keep overloading/specialization etc
sorted out in the face of function templates, member function templats, etc especially
with differing compiler implemention quirks.

Thank you for straightening this out - I'm sure it will save me much future embarassment.

Robert Ramey


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