Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:52:30

0001 /* Copyright 2023 Christian Mazakas.
0002  * Copyright 2024 Joaquin M Lopez Munoz. 
0003  * Distributed under the Boost Software License, Version 1.0.
0004  * (See accompanying file LICENSE_1_0.txt or copy at
0005  * http://www.boost.org/LICENSE_1_0.txt)
0006  *
0007  * See https://www.boost.org/libs/unordered for library home page.
0008  */
0009 
0010 #ifndef BOOST_UNORDERED_DETAIL_FOA_NODE_MAP_HANDLE_HPP
0011 #define BOOST_UNORDERED_DETAIL_FOA_NODE_MAP_HANDLE_HPP
0012 
0013 #include <boost/unordered/detail/foa/node_handle.hpp>
0014 
0015 namespace boost{
0016 namespace unordered{
0017 namespace detail{
0018 namespace foa{
0019 
0020 template <class TypePolicy, class Allocator>
0021 struct node_map_handle
0022     : public node_handle_base<TypePolicy, Allocator>
0023 {
0024 private:
0025   using base_type = node_handle_base<TypePolicy, Allocator>;
0026 
0027   using typename base_type::type_policy;
0028 
0029 public:
0030   using key_type = typename TypePolicy::key_type;
0031   using mapped_type = typename TypePolicy::mapped_type;
0032 
0033   constexpr node_map_handle() noexcept = default;
0034   node_map_handle(node_map_handle&& nh) noexcept = default;
0035 
0036   node_map_handle& operator=(node_map_handle&&) noexcept = default;
0037 
0038   key_type& key() const
0039   {
0040     BOOST_ASSERT(!this->empty());
0041     return const_cast<key_type&>(this->data().first);
0042   }
0043 
0044   mapped_type& mapped() const
0045   {
0046     BOOST_ASSERT(!this->empty());
0047     return const_cast<mapped_type&>(this->data().second);
0048   }
0049 };
0050 
0051 }
0052 }
0053 }
0054 }
0055 
0056 #endif // BOOST_UNORDERED_DETAIL_FOA_NODE_MAP_HANDLE_HPP