From 6f1a8d409d168f47c4536bcb2bbe65748e37805f Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 11 Aug 2016 10:51:50 -0500 Subject: [PATCH] Allow (de)serialization of std_cxx11::unique_ptrs also in C++98 mode. This just requires forwarding to the corresponding functions for the boost::scoped_ptr class. --- include/deal.II/base/std_cxx11/unique_ptr.h | 29 ++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/include/deal.II/base/std_cxx11/unique_ptr.h b/include/deal.II/base/std_cxx11/unique_ptr.h index 5476ec6879..e8d30338db 100644 --- a/include/deal.II/base/std_cxx11/unique_ptr.h +++ b/include/deal.II/base/std_cxx11/unique_ptr.h @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2015 by the deal.II authors +// Copyright (C) 2015, 2016 by the deal.II authors // // This file is part of the deal.II library. // @@ -32,6 +32,8 @@ DEAL_II_NAMESPACE_CLOSE #else #include +#include + DEAL_II_NAMESPACE_OPEN namespace std_cxx11 @@ -66,6 +68,31 @@ namespace std_cxx11 {} }; + + template + void save(Archive &ar, + const unique_ptr< T > &t, + const unsigned int version) + { + boost::serialization::save (ar, static_cast&>(t), version); + } + + template + void load(Archive &ar, + unique_ptr< T > &t, + const unsigned int version) + { + boost::serialization::load (ar, static_cast&>(t), version); + } + + template + void serialize(Archive &ar, + unique_ptr< T > &t, + const unsigned int version) + { + boost::serialization::serialize (ar, static_cast&>(t), version); + } + } DEAL_II_NAMESPACE_CLOSE -- 2.39.5