[serialization] and arrays with bcc32

I'm trying to serialise arrays (boost::array, actually). There aren't any specific headers for it as there are for STL types. Could one be added at some point? But I've run in to a more basic compilation problem under bcc32: This won't compile #include <boost/archive/text_oarchive.hpp> double d[3]; d[0] = 0.0; d[1] = 1.0; d[2] = 2.0; std::ofstream ofs("c:\\test.txt"); archive::text_oarchive toa(ofs); toa & d; The error I get is [C++ Error] interface_oarchive.hpp(105): E2031 Cannot cast from 'double *' to 'double ( &) const[3]' Is this a problem with Borland or is my syntax for serialising arrays? Thanks Russell

In spite of heroic efforts, we've been unable to implement "built-in" serialization for arrays for BCB compilers. If you're using BCB and you need to serialize an array you'll have to specify the loop in your class serialization code. Robert Ramey "Russell Hind" <rh_gmane@mac.com> wrote in message news:clbcd9$phm$1@sea.gmane.org...
I'm trying to serialise arrays (boost::array, actually). There aren't any specific headers for it as there are for STL types. Could one be added at some point?
But I've run in to a more basic compilation problem under bcc32: This won't compile
#include <boost/archive/text_oarchive.hpp>
double d[3]; d[0] = 0.0; d[1] = 1.0; d[2] = 2.0; std::ofstream ofs("c:\\test.txt"); archive::text_oarchive toa(ofs); toa & d;
The error I get is
[C++ Error] interface_oarchive.hpp(105): E2031 Cannot cast from 'double *' to 'double ( &) const[3]'
Is this a problem with Borland or is my syntax for serialising arrays?
Thanks
Russell
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Thanks Robert, I thought that might be the issue so that is what I've done. Cheers Russell Robert Ramey wrote:
In spite of heroic efforts, we've been unable to implement "built-in" serialization for arrays for BCB compilers. If you're using BCB and you need to serialize an array you'll have to specify the loop in your class serialization code.
Robert Ramey
"Russell Hind" <rh_gmane@mac.com> wrote in message news:clbcd9$phm$1@sea.gmane.org...
I'm trying to serialise arrays (boost::array, actually). There aren't any specific headers for it as there are for STL types. Could one be added at some point?
But I've run in to a more basic compilation problem under bcc32: This won't compile
#include <boost/archive/text_oarchive.hpp>
double d[3]; d[0] = 0.0; d[1] = 1.0; d[2] = 2.0; std::ofstream ofs("c:\\test.txt"); archive::text_oarchive toa(ofs); toa & d;
The error I get is
[C++ Error] interface_oarchive.hpp(105): E2031 Cannot cast from 'double *' to 'double ( &) const[3]'
Is this a problem with Borland or is my syntax for serialising arrays?
Thanks
Russell
_______________________________________________ Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

"Russell Hind" wrote:
[C++ Error] interface_oarchive.hpp(105): E2031 Cannot cast from 'double *' to 'double ( &) const[3]'
Is this a problem with Borland or is my syntax for serialising arrays?
This is problem with Borland. So far no fix was found but I have feeling it is doable. I didn't look on the library for some time but may in future. Any BCB improvements are highly welcomed by me. /Pavel
participants (3)
-
Pavel Vozenilek
-
Robert Ramey
-
Russell Hind