1 //-----------------------------------------------------------------------------
2 // boost variant/detail/backup_holder.hpp header file
3 // See http://www.boost.org for updates, documentation, and revision history.
4 //-----------------------------------------------------------------------------
9 // Distributed under the Boost Software License, Version 1.0. (See
10 // accompanying file LICENSE_1_0.txt or copy at
11 // http://www.boost.org/LICENSE_1_0.txt)
13 #ifndef BOOST_VARIANT_DETAIL_BACKUP_HOLDER_HPP
14 #define BOOST_VARIANT_DETAIL_BACKUP_HOLDER_HPP
16 #include <boost/config.hpp>
17 #include <boost/assert.hpp>
20 namespace detail { namespace variant {
25 private: // representation
31 ~backup_holder() BOOST_NOEXCEPT
36 explicit backup_holder(T* backup) BOOST_NOEXCEPT
41 backup_holder(const backup_holder&);
45 backup_holder& operator=(const backup_holder& rhs)
51 backup_holder& operator=(const T& rhs)
57 void swap(backup_holder& rhs) BOOST_NOEXCEPT
60 rhs.backup_ = this->backup_;
66 T& get() BOOST_NOEXCEPT
71 const T& get() const BOOST_NOEXCEPT
79 backup_holder<T>::backup_holder(const backup_holder&)
82 // not intended for copy, but do not want to prohibit syntactically
87 void swap(backup_holder<T>& lhs, backup_holder<T>& rhs) BOOST_NOEXCEPT
92 }} // namespace detail::variant
95 #endif // BOOST_VARIANT_DETAIL_BACKUP_HOLDER_HPP