Just isn't working in 1.35. With the examples included and following this documentation:
http://www.boost.org/doc/libs/1_35_0/libs/serialization/doc/derivation.html
I get link errors if I don't include
#include
and compile errors if I do:
impl/basic_binary_oprimitive.ipp: In member function ‘virtual int boost::archive::detail::output_streambuf_access::sync()’:
impl/basic_binary_oprimitive.ipp:137: error: expected primary-expression before ‘,’ token
impl/basic_binary_oprimitive.ipp:137: error: expected primary-expression before ‘>’ token
binary_oarchive_impl.hpp:31: instantiated from here
class boost::archive::detail::output_streambuf_access’ has no member named ‘basic_streambuf
Am I doing something wrong? The examples don't compile so no wonder mine doesn't! Has anyone got this to work (in Boost 1.35)? I am using g++ 4.1.2 on Linux.
My code:
// Boost containers, algorithms etc.
#include
#include
// Boost containers, algorithms etc.
using boost::archive::save_access;
using boost::archive::binary_oarchive_impl;
using boost::archive::basic_binary_oarchive;
using boost::archive::basic_binary_oprimitive;
typedef ostream::char_type ctype;
typedef ostream::traits_type ttype;
template<class Archive> class binary_net_oarchive :
public binary_oarchive_impl
{
public:
friend class save_access;
friend class basic_binary_oarchive<Archive>;
friend class binary_oarchive_impl;
friend class basic_binary_oprimitive;
typedef binary_oarchive_impl base_bin_t;
public:
binary_net_oarchive(ostream &p_stream) : base_bin_t(p_stream, 0)
{
}
template<class Type>
void
save(const Type &p_t)
{
base_bin_t::save(p_t);
}
};
#include
#include
#include
namespace boost
{
namespace archive
{
using namespace fq::comms;
template class binary_oarchive_impl;
template class detail::archive_pointer_oserializer;
}
}
#define BOOST_ARCHIVE_CUSTOM_OARCHIVE_TYPES base_msg
Regards,
Jim
--
James Vanns
Systems Programmer
Framestore CFC Ltd.