[serialization] How to serializa reference counted C arrays?
25 Jan
2006
25 Jan
'06
12:25 a.m.
Basically can anybody give me a hint how to properly serialize this class, using boost serialization library? Regards Lukasz class A { public: A( int size ) : m_size( size ) { m_ref_count = new int; *m_ref_count = 1; m_vec = new double [ m_size ]; } ~A(){ (*m_ref_count)--; if ( *m_ref_count == 0 ){ delete m_vec; } } A( const A & a ) : m_size ( a.m_size ) , m_ref_count( a.m_ref_count ) , m_vec( a.m_vec ) { (*m_ref_count)++; } int * m_ref_count; double * m_vec; int m_size; };
6869
Age (days ago)
6869
Last active (days ago)
0 comments
1 participants
participants (1)
-
Lukasz Dobrek