1 #ifndef BOOST_SERIALIZATION_DETAIL_STACK_CONSTRUCTOR_HPP
2 #define BOOST_SERIALIZATION_DETAIL_STACK_CONSTRUCTOR_HPP
4 // MS compatible compilers support #pragma once
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 // stack_constructor.hpp: serialization for loading stl collections
12 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
13 // Use, modification and distribution is subject to the Boost Software
14 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
15 // http://www.boost.org/LICENSE_1_0.txt)
17 // See http://www.boost.org for updates, documentation, and revision history.
19 #include <boost/aligned_storage.hpp>
20 #include <boost/serialization/serialization.hpp>
23 namespace serialization {
26 // reserve space on stack for an object of type T without actually
27 // construction such an object
32 return static_cast<T*>(storage_.address());
38 typedef typename boost::aligned_storage<
40 boost::alignment_of<T>::value
45 // construct element on the stack
46 template<class Archive, class T>
47 struct stack_construct : public stack_allocate<T>
49 stack_construct(Archive & ar, const unsigned int version){
50 // note borland emits a no-op without the explicit namespace
51 boost::serialization::load_construct_data_adl(
58 this->address()->~T(); // undo load_construct_data above
66 #endif // BOOST_SERIALIZATION_DETAIL_STACH_CONSTRUCTOR_HPP