Subject: [Boost-bugs] [Boost C++ Libraries] #3400: Problem with boost::serialization when only operator new[] is overrided
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-09-04 11:31:21
#3400: Problem with boost::serialization when only operator new[] is overrided
-------------------------------------------------+--------------------------
Reporter: Runar Undheim <r.undheim@â¦> | Owner: ramey
Type: Bugs | Status: new
Milestone: Boost 1.41.0 | Component: serialization
Version: Boost 1.40.0 | Severity: Problem
Keywords: |
-------------------------------------------------+--------------------------
Compilation error in serialization when only operator new[] is overrided.
It should also be possible to set operator new[] as private, but that will
give another error.
{{{
#include <stdio.h>
#include <tchar.h>
#include <fstream>
#include <boost/type_traits.hpp>
#include <boost/type_traits/has_new_operator.hpp>
#include <boost/archive/binary_oarchive.hpp>
#include <boost/archive/binary_iarchive.hpp>
#include <boost/serialization/export.hpp>
#include <boost/serialization/shared_ptr.hpp>
class A {
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
{ ar & m_i; }
int
m_i;
public:
void* operator new[](std::size_t)
{
return NULL;
}
};
BOOST_CLASS_EXPORT(A)
int _tmain(int argc, _TCHAR* argv[])
{
A
*pa;
std::ifstream ifs("test", std::ios_base::in | std::ios_base::binary);
{
boost::archive::binary_iarchive ia(ifs);
ia >> *pa;
}
return 0;
}
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3400> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:01 UTC