From: Wolfgang Bangerth Date: Thu, 11 Aug 2016 15:51:50 +0000 (-0500) Subject: Allow (de)serialization of std_cxx11::unique_ptrs also in C++98 mode. X-Git-Tag: v8.5.0-rc1~774^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f1a8d409d168f47c4536bcb2bbe65748e37805f;p=dealii.git 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. --- 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