Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:53:21

0001 // Copyright (C) 2023 Christian Mazakas
0002 //
0003 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0004 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0005 
0006 #ifndef BOOST_UNORDERED_DETAIL_OPT_STORAGE_HPP
0007 #define BOOST_UNORDERED_DETAIL_OPT_STORAGE_HPP
0008 
0009 #include <boost/config.hpp>
0010 
0011 #include <memory>
0012 
0013 namespace boost {
0014   namespace unordered {
0015     namespace detail {
0016       template <class T> union opt_storage
0017       {
0018         BOOST_ATTRIBUTE_NO_UNIQUE_ADDRESS T t_;
0019 
0020         opt_storage() {}
0021         ~opt_storage() {}
0022 
0023         T* address() noexcept { return std::addressof(t_); }
0024         T const* address() const noexcept { return std::addressof(t_); }
0025       };
0026     } // namespace detail
0027   } // namespace unordered
0028 } // namespace boost
0029 
0030 #endif // BOOST_UNORDERED_DETAIL_OPT_STORAGE_HPP