|
Boost Users : |
From: Camilo Melani (camilo.listas_at_[hidden])
Date: 2006-07-21 13:56:18
Hello,
I'd like to save and restore a adjacency_list graph in a XML file,
Does anyone has some example code or can help me?
I can serialize std::map and others classes, but when I try to serialize
the graph I get compiler errors.
Thank for the help!!
Camilo
Some part of the code:
#include <boost/config.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/adj_list_serialize.hpp>
#include <boost/dynamic_bitset.hpp>
#include <boost/archive/xml_iarchive.hpp>
#include <boost/serialization/map.hpp>
typedef adjacency_list< vecS, vecS, bidirectionalS, no_property,
no_property > Graph;
template<class Archive> void serialize(Archive & ar, const unsigned
int version)
{
ar & BOOST_SERIALIZATION_NVP(graph);
}
Error!!!
C:\Boost\include\boost-1_35\boost/archive/basic_xml_oarchive.hpp(86) :
error C2664: 'boost::mpl::assertion_failed' : cannot convert parameter 1
from 'boost::mpl::failed
************boost::serialization::is_wrapper<T>::* ***********' to
'boost::mpl::assert<false>::type'
with
[
T=boost::no_property
]
No constructor could take the source type, or constructor
overload resolution was ambiguous
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas
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