Robert Ramey wrote:
Ahhh yes. Basically the STATIC_ASSERT is preventing you from setting tracking for a primitive type. This almost HAS to be an error. Doing this will effect serialization of all char's in your program which is almost certainly what you don't want to do. If you want to do this, You'll have to wrap a char in your own type so its not a primitive anymore. Then it will pass.
Let's say the wrapper for char is A (from Martin's example). Then we
would have a dynamic array of As. If I try to serialize a pointer
pointing to one of these As inside the array, boost::serialization
crashes. Example and stack trace follows at the end.
Ivan
#include <sstream>
#include
_STL::__stl_debug_engine<bool>::_M_attach(_STL::__owned_list * __l=0x004f7db4, _STL::__owned_link * __c_node=0x00000001) Line 435 C++ _STL::_Atomic_swap(volatile long * __p=0x00000001, long __q=1243908) Line 458 C++ 004f7db4 _CxxThrowException(void * pExceptionObject=0x0012fb14, const _s__ThrowInfo * pThrowInfo=0x004b9c84) C++ boost::throw_exceptionboost::archive::archive_exception(const boost::archive::archive_exception & e={...}) Line 40 C++
boost::archive::detail::basic_oarchive_impl::save_object(boost::archive::detail::basic_oarchive
& ar={...}, const void * t=0x004f5951, const
boost::archive::detail::basic_oserializer & bos={...}) Line 284 C++
boost::archive::detail::basic_oarchive::save_object(const void *
x=0x004f5951, const boost::archive::detail::basic_oserializer &
bos={...}) Line 395 C++
boost::archive::detail::save_non_pointer_typeboost::archive::text_oarchive,A::save::invokex(boost::archive::text_oarchive
& ar={...}, const A & t={...}) Line 235 C++
boost::archive::detail::save_non_pointer_typeboost::archive::text_oarchive,A::invoke(boost::archive::text_oarchive
& ar={...}, const A & t={...}) Line 309 C++
boost::archive::saveboost::archive::text_oarchive,A(boost::archive::text_oarchive
& ar={...}, const A & t={...}) Line 551 C++
boost::archive::basic_text_oarchiveboost::archive::text_oarchive::save_override<A>()
Line 71 C++
boost::archive::detail::interface_oarchive (boost::archive::text_oarchive & ar={...}, const DynamicArray<A> &
t={...}, const unsigned int file_version=0) Line 91 C++ boost::serialization::detail::member_saver ::invoke(boost::archive::text_oarchive & ar={...}, const
DynamicArray<A> & t={...}, const unsigned int file_version=0) Line 42 C++ boost::serialization::split_member (boost::archive::text_oarchive & ar={...}, DynamicArray<A> & t={...},
const unsigned int file_version=0) Line 67 C++
DynamicArray<A>::serialize boost::serialization::access::serialize (boost::archive::text_oarchive & ar={...}, DynamicArray<A> & t={...},
const unsigned int file_version=0) Line 107 C++ boost::serialization::serialize (boost::archive::text_oarchive & ar={...}, DynamicArray<A> & t={...},
const unsigned int file_version=0) Line 78 C++ boost::serialization::serialize_adl (boost::archive::text_oarchive & ar={...}, DynamicArray<A> & t={...},
const unsigned int file_version=0) Line 121 C++ boost::archive::detail::oserializer ::save_object_data(boost::archive::detail::basic_oarchive & ar={...},
const void * x=0x0012ff54) Line 152 C++ boost::archive::detail::basic_oarchive_impl::save_object(boost::archive::detail::basic_oarchive
& ar={...}, const void * t=0x0012ff54, const
boost::archive::detail::basic_oserializer & bos={...}) Line 257 C++
boost::archive::detail::basic_oarchive::save_object(const void *
x=0x0012ff54, const boost::archive::detail::basic_oserializer &
bos={...}) Line 395 C++
boost::archive::detail::save_non_pointer_type ::save::invokex(boost::archive::text_oarchive & ar={...}, const
DynamicArray<A> & t={...}) Line 235 C++ boost::archive::detail::save_non_pointer_type ::invoke(boost::archive::text_oarchive & ar={...}, const
DynamicArray<A> & t={...}) Line 309 C++
boost::archive::save boost::archive::basic_text_oarchiveboost::archive::text_oarchive::save_override () Line 71 C++ boost::archive::detail::interface_oarchiveboost::archive::text_oarchive::operator<< () Line 81 C++ boost::archive::detail::interface_oarchiveboost::archive::text_oarchive::operator& (DynamicArray<A> & t={...}) Line 111 C++
main(int argc=1, char * * argv=0x004f7478) Line 55 C++
mainCRTStartup() Line 398 C
77e9ca90