[Serialization]Runtime error: Assertion `! detail::singleton_wrapper<T>::m_is_destroyed' failed

Hello While i was trying to run the folowing code: #include "FaceBase.h" int main() { FaceBase< EigMemberProps<int,std::string> > F(std::string("facebase.archive")); return 0; } I get the error message : /.../boost/serialization/singleton.hpp:124: static T& boost::serialization::singleton<T>::get_instance() [with T = boost::archive::detail::iserializer<boost::archive::text_iarchive, std::vector<EigMemberProps<int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<EigMemberProps<int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >]: Assertion `! detail::singleton_wrapper<T>::m_is_destroyed' failed. But the strangest it that this happen before the first instruction (the FaceBase constructor is not call). However, if i retrive the text_oarchive and text_iarchive calls in constructor and destructors, it works fine.... do you have any clue about this error ? Thanks.

sorry, the previus message is eronneous. the right code is #include <iostream> #include <boost/archive/text_oarchive.hpp> #include <boost/archive/text_iarchive.hpp> #include <boost/serialization/vector.hpp> #include <fstream> class A { public: A(){} private: //Serialization tasks friend class boost::serialization::access; template<class Archive> void serialize(Archive & , const unsigned int ) { } }; int main() { std::vector<A> eig; std::cout <<eig.size()<<std::endl; std::ofstream of("file.txt"); { boost::archive::text_oarchive oa(of); oa << eig; } of.close(); std::ifstream ifs("file.txt"); { boost::archive::text_iarchive ia(ifs); ia >> eig; } std::cout <<eig.size()<<std::endl; return 0; } 2010/7/12 Moch Ramis <mocramis@gmail.com>:
Hello
While i was trying to run the folowing code:
#include "FaceBase.h" int main() { FaceBase< EigMemberProps<int,std::string> > F(std::string("facebase.archive")); return 0; }
I get the error message :
/.../boost/serialization/singleton.hpp:124: static T& boost::serialization::singleton<T>::get_instance() [with T = boost::archive::detail::iserializer<boost::archive::text_iarchive, std::vector<EigMemberProps<int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<EigMemberProps<int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >]: Assertion `! detail::singleton_wrapper<T>::m_is_destroyed' failed.
But the strangest it that this happen before the first instruction (the FaceBase constructor is not call). However, if i retrive the text_oarchive and text_iarchive calls in constructor and destructors, it works fine....
do you have any clue about this error ?
Thanks.
participants (1)
-
Moch Ramis