|
Boost Users : |
From: Peter Whaite (boost_at_[hidden])
Date: 2006-01-12 17:16:52
Robert Ramey <ramey_at_[hidden]> wrote:
> Which version of boost are you using? I believe this may have come up and
> been addressed in 1_33_1?
Now that spirit is fixed I have tried again on the CVS (1_34).
Unfortunately I now have a different error -- it prefers the serialize
template over my serialize function?
#include <map>
#include <fstream>
#include <boost/archive/xml_wiarchive.hpp>
#include <boost/serialization/utility.hpp> // For std::pair
struct Mark {};
enum MarkId {low,median,high};
typedef std::map<MarkId,Mark> MarkMap;
void serialize(boost::archive::xml_wiarchive & ar, MarkMap & m, const unsigned int version)
{
MarkMap::iterator it;
for (it = m.begin() ; it != m.end(); ++it) {
ar & boost::serialization::make_nvp("item", *it);
}
}
int main(int argc, char* argv[])
{
std::wifstream ifs;
boost::archive::xml_wiarchive ar(ifs);
MarkMap marks;
ar & boost::serialization::make_nvp("marks",marks);
}
% g++ -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
% make -k tsrz
g++ -c tsrz.cpp -I/usr/local/include -isystem /usr/local/include/boost-1_34 -isystem ./boost -g -Wall -Wno-non-virtual-dtor -Wno-inline -ftemplate-depth-255 -finline-functions -MMD -MF.deps/tsrz.d
/usr/local/include/boost-1_34/boost/serialization/access.hpp: In static member
function `static void boost::serialization::access::serialize(Archive&, T&,
unsigned int) [with Archive = boost::archive::xml_wiarchive, T = Mark]':
/usr/local/include/boost-1_34/boost/serialization/serialization.hpp:81: instantiated from `void boost::serialization::serialize(Archive&, T&, unsigned int) [with Archive = boost::archive::xml_wiarchive, T = Mark]'
/usr/local/include/boost-1_34/boost/serialization/serialization.hpp:140: instantiated from `void boost::serialization::serialize_adl(Archive&, T&, unsigned int) [with Archive = boost::archive::xml_wiarchive, T = Mark]'
/usr/local/include/boost-1_34/boost/archive/detail/iserializer.hpp:160: instantiated from `void boost::archive::detail::iserializer<Archive, T>::load_object_data(boost::archive::detail::basic_iarchive&, void*, unsigned int) const [with Archive = boost::archive::xml_wiarchive, T = Mark]'
/usr/include/c++/3.2.2/bits/locale_facets.h:111: instantiated from here
/usr/local/include/boost-1_34/boost/serialization/access.hpp:109: no matching
function for call to `Mark::serialize(boost::archive::xml_wiarchive&, const
unsigned int&)'
make: *** [.deps/tsrz.d] Error 1
make: Target `tsrz' not remade because of errors.
-- Peter Whaite (http://whaite.ca)
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