12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- #ifndef BOOST_SERIALIZATION_DETAIL_STACH_CONSTRUCTOR_HPP
- #define BOOST_SERIALIZATION_DETAIL_STACH_CONSTRUCTOR_HPP
- #if defined(_MSC_VER) && (_MSC_VER >= 1020)
- # pragma once
- #endif
- #if defined(_MSC_VER) && (_MSC_VER <= 1020)
- # pragma warning (disable : 4786)
- #endif
- #include <boost/aligned_storage.hpp>
- namespace boost{
- namespace serialization {
- namespace detail {
- template<typename T >
- struct stack_allocate
- {
- T * address() {
- return static_cast<T*>(storage_.address());
- }
- T & reference() {
- return * address();
- }
- private:
- typedef BOOST_DEDUCED_TYPENAME boost::aligned_storage<
- sizeof(T),
- #if BOOST_WORKAROUND(__BORLANDC__,BOOST_TESTED_AT(0x560))
- 8
- #else
- boost::alignment_of<T>::value
- #endif
- > type;
- type storage_;
- };
- template<class Archive, class T>
- struct stack_construct : public stack_allocate<T>
- {
- stack_construct(Archive & ar, const unsigned int version){
-
- boost::serialization::load_construct_data_adl(
- ar,
- this->address(),
- version
- );
- }
- ~stack_construct(){
- this->address()->~T();
- }
- };
- }
- }
- }
- #endif
|