⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scoped_ptr.hpp

📁 CGAL is a collaborative effort of several sites in Europe and Israel. The goal is to make the most i
💻 HPP
字号:
#ifndef BOOST_SERIALIZATION_SCOPED_PTR_HPP_VP_2003_10_30#define BOOST_SERIALIZATION_SCOPED_PTR_HPP_VP_2003_10_30#if defined(_MSC_VER) && (_MSC_VER >= 1020)# pragma once#endif//  Copyright (c) 2003 Vladimir Prus.// Use, modification and distribution is subject to the Boost Software// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at// http://www.boost.org/LICENSE_1_0.txt)// Provides non-intrusive serialization for boost::scoped_ptr// Does not allow to serialize scoped_ptr's to builtin types.#include <boost/config.hpp>#include <boost/scoped_ptr.hpp>#include <boost/serialization/nvp.hpp>#include <boost/serialization/split_free.hpp>// function specializations must be defined in the appropriate// namespace - boost::serializationnamespace boost { #ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUPnamespace serialization {#endif        template<class Archive, class T>    void save(        Archive & ar,         const boost::scoped_ptr<T> & t,         const unsigned int /* version */    ){        T* r = t.get();        ar << boost::serialization::make_nvp("scoped_ptr", r);    }    template<class Archive, class T>    void load(        Archive & ar,         boost::scoped_ptr<T> & t,         const unsigned int /* version */    ){        T* r;        ar >> boost::serialization::make_nvp("scoped_ptr", r);        t.reset(r);     }    template<class Archive, class T>    void serialize(        Archive& ar,         boost::scoped_ptr<T>& t,         const unsigned int version    ){        boost::serialization::split_free(ar, t, version);    }#ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP} // namespace serialization#endif} // namespace boost#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -