8#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_INLINE_CONTAINER_MAP_REFERENCE_HPP_
9#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_INLINE_CONTAINER_MAP_REFERENCE_HPP_
13#include "arene/base/detail/exceptions.hpp"
15#include "arene/base/inline_container/detail/compare.hpp"
16#include "arene/base/inline_container/detail/container_base_type.hpp"
17#include "arene/base/inline_container/detail/erased_member_function.hpp"
21#include "arene/base/ranges/detail/range_interface.hpp"
23#include "arene/base/stdlib_choice/cstddef.hpp"
24#include "arene/base/stdlib_choice/enable_if.hpp"
25#include "arene/base/stdlib_choice/integral_constant.hpp"
26#include "arene/base/stdlib_choice/is_copy_constructible.hpp"
27#include "arene/base/stdlib_choice/is_same.hpp"
28#include "arene/base/stdlib_choice/pair.hpp"
39namespace inline_map_reference_detail {
45template <
class Key,
class Compare>
46extern constexpr bool comparison_is_noexcept_v{inline_container::detail::compare_wrapper<Compare, Key>::
47 template comparison_is_noexcept<Key>};
51template <
class MapBase>
52using iterator = inline_map_reference_iterator<MapBase, false>;
57template <
class MapBase>
58using const_iterator = inline_map_reference_iterator<MapBase, true>;
63template <
class MapBase>
64struct const_operations {
69 template <
class R,
class... Ts>
70 using erased_op_type =
auto (*)(MapBase
const*, Ts...) -> R;
73 erased_op_type<typename MapBase::compare_type> key_comp;
75 erased_op_type<typename MapBase::size_type> size;
77 erased_op_type<typename MapBase::size_type> capacity;
79 erased_op_type<typename MapBase::size_type> max_size;
81 erased_op_type<const_iterator<MapBase>,
typename MapBase::key_type
const&> find;
83 erased_op_type<bool, typename MapBase::key_type const&> contains;
85 erased_op_type<typename MapBase::size_type, typename MapBase::key_type const&> count;
87 erased_op_type<const_iterator<MapBase>,
typename MapBase::key_type
const&> lower_bound;
89 erased_op_type<const_iterator<MapBase>,
typename MapBase::key_type
const&> upper_bound;
91 erased_op_type<std::pair<const_iterator<MapBase>, const_iterator<MapBase>>,
typename MapBase::key_type
const&>
94 erased_op_type<typename MapBase::mapped_type const&, typename MapBase::key_type const&> at;
96 erased_op_type<const_iterator<MapBase>> begin;
98 erased_op_type<const_iterator<MapBase>> end;
104template <
class MapBase>
110 template <
class R,
class... Ts>
111 using erased_op_type =
auto (*)(MapBase*, Ts...) -> R;
115 const_operations<MapBase>
const* const_ops;
117 erased_op_type<iterator<MapBase>,
typename MapBase::key_type
const&> find;
119 erased_op_type<iterator<MapBase>,
typename MapBase::key_type
const&> lower_bound;
121 erased_op_type<iterator<MapBase>,
typename MapBase::key_type
const&> upper_bound;
123 erased_op_type<std::pair<iterator<MapBase>, iterator<MapBase>>,
typename MapBase::key_type
const&> equal_range;
125 erased_op_type<typename MapBase::mapped_type&, typename MapBase::key_type const&> operator_index;
127 erased_op_type<typename MapBase::mapped_type&, typename MapBase::key_type const&> at;
129 erased_op_type<std::pair<iterator<MapBase>,
bool>,
typename MapBase::value_type
const&> insert;
132 std::pair<iterator<MapBase>,
bool>,
133 typename MapBase::key_type
const&,
134 typename MapBase::mapped_type
const&>
137 erased_op_type<iterator<MapBase>,
typename MapBase::key_type
const&> erase_key;
139 erased_op_type<iterator<MapBase>, const_iterator<MapBase>> erase_pos;
141 erased_op_type<iterator<MapBase>, const_iterator<MapBase>, const_iterator<MapBase>> erase_rng;
143 erased_op_type<void> clear;
145 erased_op_type<iterator<MapBase>> begin;
147 erased_op_type<iterator<MapBase>> end;
155template <
class MemFn, MemFn Func,
class Return = member_function_return_t<MemFn>>
156extern constexpr auto erased_member_function = inline_container::detail::erased_member_function<MemFn, Func, Return>;
165template <
class Map,
class T, T Value,
class MapBase = inline_container::detail::container_base_type_t<Map>>
166auto erased_integral_constant_function(MapBase
const*)
noexcept -> T {
189 class MapBase = inline_container::detail::container_base_type_t<Map>,
190 bool ComparisonIsNoexcept = comparison_is_noexcept_v<typename Map::key_type, typename Map::compare_type>>
191extern constexpr auto const_map_operations_with_at = const_operations<MapBase>{
192 erased_member_function<
decltype(&Map::key_comp), &Map::key_comp>,
193 erased_member_function<
decltype(&Map::size), &Map::size>,
194 &erased_integral_constant_function<Map, std::size_t, Map::capacity>,
195 &erased_integral_constant_function<Map, std::size_t, Map::max_size>,
196 erased_member_function<
197 auto (Map::*)(
typename Map::key_type
const&)
const noexcept(ComparisonIsNoexcept)->
typename Map::const_iterator,
199 const_iterator<MapBase>>,
200 erased_member_function<
201 auto (Map::*)(
typename Map::key_type
const&)
const noexcept(ComparisonIsNoexcept)->bool,
203 erased_member_function<
204 auto (Map::*)(
typename Map::key_type
const&)
const noexcept(ComparisonIsNoexcept)->
typename Map::size_type,
206 erased_member_function<
207 auto (Map::*)(
typename Map::key_type
const&)
const noexcept(ComparisonIsNoexcept)->typename Map::const_iterator,
209 const_iterator<MapBase>>,
210 erased_member_function<
211 auto (Map::*)(
typename Map::key_type
const&)
const noexcept(ComparisonIsNoexcept)->
typename Map::const_iterator,
213 const_iterator<MapBase>>,
214 erased_member_function<
215 auto (Map::*)(
typename Map::key_type
const&)
const noexcept(ComparisonIsNoexcept)
216 ->std::pair<
typename Map::const_iterator,
typename Map::const_iterator>,
218 std::pair<const_iterator<MapBase>, const_iterator<MapBase>>>,
219 erased_member_function<
220 auto (Map::*)(
typename Map::key_type
const&)
const noexcept(
false)->
typename Map::mapped_type
const&,
222 erased_member_function<
decltype(&Map::cbegin), &Map::begin, const_iterator<MapBase>>,
223 erased_member_function<
decltype(&Map::cend), &Map::end, const_iterator<MapBase>>
244 class MapBase = inline_container::detail::container_base_type_t<Map>,
245 bool ComparisonIsNoexcept = comparison_is_noexcept_v<typename Map::key_type, typename Map::compare_type>>
246extern constexpr auto const_map_operations_without_at = const_operations<MapBase>{
247 erased_member_function<
decltype(&Map::key_comp), &Map::key_comp>,
248 erased_member_function<
decltype(&Map::size), &Map::size>,
249 &erased_integral_constant_function<Map, std::size_t, Map::capacity>,
250 &erased_integral_constant_function<Map, std::size_t, Map::max_size>,
251 erased_member_function<
252 auto (Map::*)(
typename Map::key_type
const&)
const noexcept(ComparisonIsNoexcept)->
typename Map::const_iterator,
254 const_iterator<MapBase>>,
255 erased_member_function<
256 auto (Map::*)(
typename Map::key_type
const&)
const noexcept(ComparisonIsNoexcept)->bool,
258 erased_member_function<
259 auto (Map::*)(
typename Map::key_type
const&)
const noexcept(ComparisonIsNoexcept)->
typename Map::size_type,
261 erased_member_function<
262 auto (Map::*)(
typename Map::key_type
const&)
const noexcept(ComparisonIsNoexcept)->typename Map::const_iterator,
264 const_iterator<MapBase>>,
265 erased_member_function<
266 auto (Map::*)(
typename Map::key_type
const&)
const noexcept(ComparisonIsNoexcept)->
typename Map::const_iterator,
268 const_iterator<MapBase>>,
269 erased_member_function<
270 auto (Map::*)(
typename Map::key_type
const&)
const noexcept(ComparisonIsNoexcept)
271 ->std::pair<
typename Map::const_iterator,
typename Map::const_iterator>,
273 std::pair<const_iterator<MapBase>, const_iterator<MapBase>>>,
275 erased_member_function<
decltype(&Map::cbegin), &Map::begin, const_iterator<MapBase>>,
276 erased_member_function<
decltype(&Map::cend), &Map::end, const_iterator<MapBase>>
286template <
class Map,
class MapBase = inline_container::detail::container_base_type_t<Map>>
287class erase_fn_iterator_argument_adaptor : inline_map_detail::inline_map_passkey_base<MapBase> {
292 static auto restored(const_iterator<MapBase> iter)
noexcept ->
typename Map::const_iterator {
295 constexpr auto passkey =
typename inline_map_detail::inline_map_passkey_base<MapBase>::inline_map_passkey{};
297 return typename Map::const_iterator{
299 static_cast<Map const*
>(iter.get_map(passkey)),
300 static_cast<index_type
>(iter.get_index(passkey))
308 static auto derived(MapBase* map)
noexcept -> Map& {
return *
static_cast<Map*
>(map); }
318 static auto one_argument_overload(MapBase* map, const_iterator<MapBase> pos)
noexcept -> iterator<MapBase> {
319 return iterator<MapBase>{derived(map).erase(restored(pos))};
330 static auto two_argument_overload(MapBase* map, const_iterator<MapBase> first, const_iterator<MapBase> last)
noexcept
331 -> iterator<MapBase> {
332 return iterator<MapBase>{derived(map).erase(restored(first), restored(last))};
354 class MapBase = inline_container::detail::container_base_type_t<Map>,
355 bool ComparisonIsNoexcept = comparison_is_noexcept_v<typename Map::key_type, typename Map::compare_type>>
356extern constexpr auto map_operations_with_at = operations<MapBase>{
357 &const_map_operations_with_at<Map>,
358 erased_member_function<
359 auto (Map::*)(
typename Map::key_type
const&)
noexcept(ComparisonIsNoexcept)->
typename Map::iterator,
362 erased_member_function<
363 auto (Map::*)(
typename Map::key_type
const&)
noexcept(ComparisonIsNoexcept)->typename Map::iterator,
366 erased_member_function<
367 auto (Map::*)(
typename Map::key_type
const&)
noexcept(ComparisonIsNoexcept)->
typename Map::iterator,
370 erased_member_function<
371 auto (Map::*)(
typename Map::key_type
const&)
noexcept(ComparisonIsNoexcept)
372 ->std::pair<
typename Map::iterator,
typename Map::iterator>,
374 std::pair<iterator<MapBase>, iterator<MapBase>>>,
375 erased_member_function <
auto (Map::*)(
typename Map::key_type
const&)
noexcept(
false)->
typename Map::mapped_type&,
377 erased_member_function<
378 auto (Map::*)(
typename Map::key_type
const&)
noexcept(
false)->typename Map::mapped_type&,
380 erased_member_function<
381 auto (Map::*)(
typename Map::value_type
const&)
noexcept(
false)->std::pair<typename Map::iterator, bool>,
383 std::pair<iterator<MapBase>,
bool>>,
384 erased_member_function<
385 auto (Map::*)(
typename Map::key_type
const&,
typename Map::mapped_type
const&)
noexcept(
false)
386 ->std::pair<
typename Map::iterator,
bool>,
387 &Map::insert_or_assign,
388 std::pair<iterator<MapBase>,
bool>>,
389 erased_member_function<
390 auto (Map::*)(
typename Map::key_type
const&)
noexcept(ComparisonIsNoexcept)->
typename Map::iterator,
393 &erase_fn_iterator_argument_adaptor<Map>::one_argument_overload,
394 &erase_fn_iterator_argument_adaptor<Map>::two_argument_overload,
395 erased_member_function<
decltype(&Map::clear), &Map::clear>,
396 erased_member_function<
auto (Map::*)()
noexcept ->
typename Map::iterator, &Map::begin, iterator<MapBase>>,
397 erased_member_function<
auto (Map::*)()
noexcept ->
typename Map::iterator, &Map::end, iterator<MapBase>>
418 class MapBase = inline_container::detail::container_base_type_t<Map>,
419 bool ComparisonIsNoexcept = comparison_is_noexcept_v<typename Map::key_type, typename Map::compare_type>>
420extern constexpr auto map_operations_without_at = operations<MapBase>{
421 &const_map_operations_without_at<Map>,
422 erased_member_function<
423 auto (Map::*)(
typename Map::key_type
const&)
noexcept(ComparisonIsNoexcept)->
typename Map::iterator,
426 erased_member_function<
427 auto (Map::*)(
typename Map::key_type
const&)
noexcept(ComparisonIsNoexcept)->typename Map::iterator,
430 erased_member_function<
431 auto (Map::*)(
typename Map::key_type
const&)
noexcept(ComparisonIsNoexcept)->
typename Map::iterator,
434 erased_member_function<
435 auto (Map::*)(
typename Map::key_type
const&)
noexcept(ComparisonIsNoexcept)
436 ->std::pair<
typename Map::iterator,
typename Map::iterator>,
438 std::pair<iterator<MapBase>, iterator<MapBase>>>,
439 erased_member_function <
auto (Map::*)(
typename Map::key_type
const&)
noexcept(
false)->
typename Map::mapped_type&,
442 erased_member_function<
443 auto (Map::*)(
typename Map::value_type
const&)
noexcept(
false)->std::pair<
typename Map::iterator,
bool>,
445 std::pair<iterator<MapBase>,
bool>>,
446 erased_member_function<
447 auto (Map::*)(
typename Map::key_type
const&,
typename Map::mapped_type
const&)
noexcept(
false)
448 ->std::pair<typename Map::iterator, bool>,
449 &Map::insert_or_assign,
450 std::pair<iterator<MapBase>,
bool>>,
451 erased_member_function<
452 auto (Map::*)(
typename Map::key_type
const&)
noexcept(ComparisonIsNoexcept)->typename Map::iterator,
455 &erase_fn_iterator_argument_adaptor<Map>::one_argument_overload,
456 &erase_fn_iterator_argument_adaptor<Map>::two_argument_overload,
457 erased_member_function<
decltype(&Map::clear), &Map::clear>,
458 erased_member_function<
auto (Map::*)()
noexcept ->
typename Map::iterator, &Map::begin, iterator<MapBase>>,
459 erased_member_function<
auto (Map::*)()
noexcept ->
typename Map::iterator, &Map::end, iterator<MapBase>>
465template <
class Derived>
466class const_inline_map_reference_interface {
470 auto derived() const noexcept -> Derived const& {
return static_cast<Derived const&
>(*this); }
477 auto map() const noexcept -> typename D::map_base_type const* {
478 return derived().map_ptr();
486 auto ops() const noexcept -> const_operations<typename D::map_base_type> const& {
487 return *derived().const_ops_ptr();
494 static constexpr bool comparison_is_noexcept{inline_map_reference_detail::comparison_is_noexcept_v<
495 typename D::key_type,
496 typename D::compare_type>};
514 template <
class Actual,
class Expected = Derived>
515 explicit const_inline_map_reference_interface(Actual*)
noexcept {
518 "'Derived' type mismatch.\n"
519 "Please verify that 'Derived' is defined correctly when using 'const_inline_map_reference_interface' as a CRTP "
524 ~const_inline_map_reference_interface() =
default;
526 const_inline_map_reference_interface(const_inline_map_reference_interface
const&) =
default;
528 const_inline_map_reference_interface(const_inline_map_reference_interface&&) =
default;
530 auto operator=(const_inline_map_reference_interface
const&) -> const_inline_map_reference_interface& =
default;
532 auto operator=(const_inline_map_reference_interface&&) -> const_inline_map_reference_interface& =
default;
537 template <
class D = Derived>
538 auto key_comp() const noexcept(std::is_nothrow_copy_constructible<typename D::compare_type>::value)
539 -> decltype(ops<D>().key_comp(map<D>())) {
540 return ops<D>().key_comp(map<D>());
545 template <
class D = Derived>
546 auto size() const noexcept -> decltype(ops<D>().size(map<D>())) {
547 return ops<D>().size(map<D>());
552 template <
class D = Derived>
553 auto capacity() const noexcept -> decltype(ops<D>().capacity(map<D>())) {
554 return ops<D>().capacity(map<D>());
559 template <
class D = Derived>
560 auto max_size() const noexcept -> decltype(ops<D>().max_size(map<D>())) {
561 return ops<D>().max_size(map<D>());
567 template <
class D = Derived>
568 auto find(
typename D::key_type
const& key)
const noexcept(comparison_is_noexcept<D>)
569 ->
decltype(ops<D>().find(map<D>(), key)) {
570 return ops<D>().find(map<D>(), key);
577 template <
class D = Derived>
578 auto contains(
typename D::key_type
const& key)
const noexcept(comparison_is_noexcept<D>)
579 ->
decltype(ops<D>().contains(map<D>(), key)) {
580 return ops<D>().contains(map<D>(), key);
587 template <
class D = Derived>
588 auto count(
typename D::key_type
const& key)
const noexcept(comparison_is_noexcept<D>)
589 ->
decltype(ops<D>().count(map<D>(), key)) {
590 return ops<D>().count(map<D>(), key);
598 template <
class D = Derived>
599 auto lower_bound(
typename D::key_type
const& key)
const noexcept(comparison_is_noexcept<D>)
600 ->
decltype(ops<D>().lower_bound(map<D>(), key)) {
601 return ops<D>().lower_bound(map<D>(), key);
609 template <
class D = Derived>
610 auto upper_bound(
typename D::key_type
const& key)
const noexcept(comparison_is_noexcept<D>)
611 ->
decltype(ops<D>().upper_bound(map<D>(), key)) {
612 return ops<D>().upper_bound(map<D>(), key);
621 template <
class D = Derived>
622 auto equal_range(
typename D::key_type
const& key)
const noexcept(comparison_is_noexcept<D>)
623 ->
decltype(ops<D>().equal_range(map<D>(), key)) {
624 return ops<D>().equal_range(map<D>(), key);
635 bool AreExceptionsEnabled = detail::are_exceptions_enabled::value,
637 auto at(
typename D::key_type
const& key)
const noexcept(
false) ->
decltype(ops<D>().at(map<D>(), key)) {
638 return ops<D>().at(map<D>(), key);
643 template <
class D = Derived>
644 auto begin() const noexcept -> decltype(ops<D>().begin(map<D>())) {
645 return ops<D>().begin(map<D>());
650 template <
class D = Derived>
651 auto end() const noexcept -> decltype(ops<D>().end(map<D>())) {
652 return ops<D>().end(map<D>());
685template <
class Key,
class Value,
class Compare>
687 :
public inline_map_reference_detail::const_inline_map_reference_interface<
688 inline_map_reference<Key, Value, Compare>>
689 ,
public ranges::detail::range_interface<inline_map_reference<Key, Value, Compare>> {
692 using map_base_type = inline_map_detail::inline_map_base<Key, Value, Compare>;
695 using const_ops_type = inline_map_reference_detail::const_operations<map_base_type>;
698 using ops_type = inline_map_reference_detail::operations<map_base_type>;
723 using interface_base = inline_map_reference_detail::const_inline_map_reference_interface<inline_map_reference>;
726 using range_base = ranges::detail::range_interface<inline_map_reference<Key, Value, Compare>>;
738 static constexpr bool comparison_is_noexcept{inline_container::detail::compare_wrapper<Compare, Key>::
739 template comparison_is_noexcept<Key>};
764 bool AreExceptionsEnabled = detail::are_exceptions_enabled::value,
767 : interface_base{
this},
770 ops_ptr_{&inline_map_reference_detail::map_operations_with_at<inline_map<Key, Value, Capacity, Compare>>} {}
778 bool AreExceptionsEnabled = detail::are_exceptions_enabled::value,
781 : interface_base{
this},
784 ops_ptr_{&inline_map_reference_detail::map_operations_without_at<inline_map<Key, Value, Capacity, Compare>>} {}
791 template <std::
size_t Capacity>
799 auto find(
key_type const& key)
const noexcept(comparison_is_noexcept) ->
decltype(ops_ptr_->find(map_ptr_, key)) {
800 return ops_ptr_->find(map_ptr_, key);
809 ->
decltype(ops_ptr_->lower_bound(map_ptr_, key)) {
810 return ops_ptr_->lower_bound(map_ptr_, key);
819 ->
decltype(ops_ptr_->upper_bound(map_ptr_, key)) {
820 return ops_ptr_->upper_bound(map_ptr_, key);
830 ->
decltype(ops_ptr_->equal_range(map_ptr_, key)) {
831 return ops_ptr_->equal_range(map_ptr_, key);
846 auto operator[](
key_type const& key)
const noexcept(
false) ->
decltype(ops_ptr_->operator_index(map_ptr_, key)) {
847 return ops_ptr_->operator_index(map_ptr_, key);
857 bool AreExceptionsEnabled = detail::are_exceptions_enabled::value,
859 auto at(
key_type const& key)
const noexcept(
false) ->
decltype(ops_ptr_->at(map_ptr_, key)) {
860 return ops_ptr_->at(map_ptr_, key);
879 auto insert(
value_type const& value)
const noexcept(
false) ->
decltype(ops_ptr_->insert(map_ptr_, value)) {
880 return ops_ptr_->insert(map_ptr_, value);
902 ->
decltype(ops_ptr_->insert_or_assign(map_ptr_, key, mapped)) {
903 return ops_ptr_->insert_or_assign(map_ptr_, key, mapped);
912 ->
decltype(ops_ptr_->erase_key(map_ptr_, key)) {
913 return ops_ptr_->erase_key(map_ptr_, key);
922 return ops_ptr_->erase_pos(map_ptr_, pos);
932 ->
decltype(ops_ptr_->erase_rng(map_ptr_, first, last)) {
933 return ops_ptr_->erase_rng(map_ptr_, first, last);
940 auto clear() const noexcept -> decltype(ops_ptr_->
clear(map_ptr_)) {
return ops_ptr_->clear(map_ptr_); }
945 auto begin() const noexcept -> decltype(ops_ptr_->
begin(map_ptr_)) {
return ops_ptr_->begin(map_ptr_); }
950 auto end() const noexcept -> decltype(ops_ptr_->
end(map_ptr_)) {
return ops_ptr_->end(map_ptr_); }
968template <
class Key,
class Value,
class Compare>
970 :
public inline_map_reference_detail::const_inline_map_reference_interface<
971 const_inline_map_reference<Key, Value, Compare>>
972 ,
public ranges::detail::range_interface<const_inline_map_reference<Key, Value, Compare>> {
975 using map_base_type = inline_map_detail::inline_map_base<Key, Value, Compare>;
978 using const_ops_type = inline_map_reference_detail::const_operations<map_base_type>;
1003 using interface_base = inline_map_reference_detail::const_inline_map_reference_interface<const_inline_map_reference>;
1006 using range_base = ranges::detail::range_interface<const_inline_map_reference<Key, Value, Compare>>;
1031 bool AreExceptionsEnabled = detail::are_exceptions_enabled::value,
1034 : interface_base{
this},
1037 const_ops_ptr_{&inline_map_reference_detail::const_map_operations_with_at<
1038 inline_map<Key, Value, Capacity, Compare>>} {}
1046 bool AreExceptionsEnabled = detail::are_exceptions_enabled::value,
1049 : interface_base{
this},
1052 const_ops_ptr_{&inline_map_reference_detail::const_map_operations_without_at<
1053 inline_map<Key, Value, Capacity, Compare>>} {}
1060 template <std::
size_t Capacity>
1067 : interface_base{
this},
1069 map_ptr_{other.map_ptr()},
1070 const_ops_ptr_{other.const_ops_ptr()} {}
1081template <
typename Key,
typename Value,
typename Compare>
auto map_ptr() const noexcept -> map_base_type const *
obtain a pointer to the map base
Definition map_reference.hpp:1018
inline_map_detail::inline_map_base< Key, Value, Compare > map_base_type
alias to the capacity-erased map base class
Definition map_reference.hpp:975
const_inline_map_reference(inline_map< Key, Value, Capacity, Compare > const &map) noexcept
construct a const_inline_map_reference of a map
Definition map_reference.hpp:1033
::arene::base::reverse_iterator< iterator > reverse_iterator
The type of an iterator that provides non- const access to the elements and iterates in reverse throu...
Definition map_reference.hpp:994
inline_map_reference_iterator< map_base_type, true > iterator
iterator type of a const reference to the map
Definition map_reference.hpp:989
std::pair< Key const, Value > value_type
value type of the map
Definition map_reference.hpp:985
::arene::base::reverse_iterator< const_iterator > const_reverse_iterator
The type of an iterator that provides const access to the elements and iterates in reverse through th...
Definition map_reference.hpp:997
const_inline_map_reference(inline_map_reference< Key, Value, Compare > other) noexcept
construct a const_inline_map_reference from an inline_map_reference
Definition map_reference.hpp:1066
inline_map_reference_detail::const_operations< map_base_type > const_ops_type
alias to const operations type
Definition map_reference.hpp:978
Key key_type
key type of the map
Definition map_reference.hpp:981
typename map_base_type::size_type size_type
size type of the map
Definition map_reference.hpp:987
Compare compare_type
compare type of the map
Definition map_reference.hpp:999
auto const_ops_ptr() const noexcept -> const_ops_type const *
obtain a pointer to the const operations
Definition map_reference.hpp:1023
Value mapped_type
mapped type of the map
Definition map_reference.hpp:983
const_inline_map_reference(inline_map< Key, Value, Capacity, Compare > const &&)=delete
construct a const_inline_map_reference of a map
iterator const_iterator
const iterator type of the underlying map
Definition map_reference.hpp:991
iterator type used by inline_map_reference and const_inline_map_reference
Definition map_reference_iterator.hpp:61
A reference class to an inline_map object, with size-erased type.
Definition map_reference.hpp:689
auto operator[](key_type const &key) const noexcept(false) ->
obtain a reference to the mapped value for the specified key
Definition map_reference.hpp:846
auto equal_range(key_type const &key) const noexcept(comparison_is_noexcept) ->
find the sequence of elements whose keys compare equivalent to a given key
Definition map_reference.hpp:829
auto insert(value_type const &value) const noexcept(false) ->
insert an element in the map
Definition map_reference.hpp:879
Key key_type
key type of the map
Definition map_reference.hpp:701
::arene::base::reverse_iterator< iterator > reverse_iterator
The type of an iterator that provides non- const access to the elements and iterates in reverse throu...
Definition map_reference.hpp:714
auto end() const noexcept ->
obtain an iterator referring to one past the last element in the sorted range of elements
Definition map_reference.hpp:950
inline_map_reference_detail::operations< map_base_type > ops_type
alias to non-const operations type
Definition map_reference.hpp:698
Value mapped_type
mapped type of the map
Definition map_reference.hpp:703
auto ops_ptr() const noexcept -> ops_type const *
obtain a pointer to the non-const operations
Definition map_reference.hpp:751
std::pair< Key const, Value > value_type
value type of the map
Definition map_reference.hpp:705
auto erase(key_type const &key) const noexcept(comparison_is_noexcept) ->
remove element with the corresponding key, if there is one
Definition map_reference.hpp:911
auto insert_or_assign(key_type const &key, mapped_type const &mapped) const noexcept(false) ->
insert an element in the map or update an existing element
Definition map_reference.hpp:901
auto clear() const noexcept ->
destroy all elements in the assocaited inline_map
Definition map_reference.hpp:940
auto erase(const_iterator pos) const noexcept ->
remove the element at the specified position
Definition map_reference.hpp:921
inline_map_reference(inline_map< Key, Value, Capacity, Compare > const &&)=delete
construct an inline_map_reference of a map
Compare compare_type
compare type of the map
Definition map_reference.hpp:719
inline_map_reference_iterator< map_base_type, true > const_iterator
const iterator type of the underlying map
Definition map_reference.hpp:711
inline_map_reference(inline_map< Key, Value, Capacity, Compare > &map) noexcept
construct an inline_map_reference of a map
Definition map_reference.hpp:766
auto const_ops_ptr() const noexcept -> const_ops_type const *
obtain a pointer to the const operations
Definition map_reference.hpp:756
auto lower_bound(key_type const &key) const noexcept(comparison_is_noexcept) ->
find the first element which is not less than a given key
Definition map_reference.hpp:808
auto find(key_type const &key) const noexcept(comparison_is_noexcept) ->
obtain an iterator to the first element with a given key
Definition map_reference.hpp:799
inline_map_reference_iterator< map_base_type, false > iterator
iterator type of a reference to the map
Definition map_reference.hpp:709
::arene::base::reverse_iterator< const_iterator > const_reverse_iterator
The type of an iterator that provides const access to the elements and iterates in reverse through th...
Definition map_reference.hpp:717
inline_map_reference_detail::const_operations< map_base_type > const_ops_type
alias to const operations type
Definition map_reference.hpp:695
auto upper_bound(key_type const &key) const noexcept(comparison_is_noexcept) ->
find the first element which is greater than a given key
Definition map_reference.hpp:818
inline_map_detail::inline_map_base< Key, Value, Compare > map_base_type
alias to the map base class
Definition map_reference.hpp:692
auto at(key_type const &key) const noexcept(false) ->
obtain a reference to the mapped value for the specified key
Definition map_reference.hpp:859
auto begin() const noexcept ->
obtain an iterator referring to the beginning of the sorted range of elements
Definition map_reference.hpp:945
auto erase(const_iterator first, const_iterator last) const noexcept ->
remove elements in the specified range
Definition map_reference.hpp:931
auto map_ptr() const noexcept -> map_base_type *
obtain a pointer to the map base
Definition map_reference.hpp:746
typename map_base_type::size_type size_type
size type of the map
Definition map_reference.hpp:707
A container similar to std::map that has a fixed capacity.
Definition map.hpp:153
An opt-in trait to indicate that a range type is a borrowed range.
Definition enable_borrowed_range.hpp:31
A backport of the constexpr std::reverse_iterator from C++17.
Definition reverse_iterator.hpp:188
static constexpr value_type value
Definition integral_constant.hpp:34
Definition external_vector.hpp:803
Definition accumulate.hpp:37
conditional_t<(MaxValue<=smallest_integer_for_detail::max_uint8), std::uint8_t, conditional_t<(MaxValue<=smallest_integer_for_detail::max_uint16), std::uint16_t, conditional_t<(MaxValue<=smallest_integer_for_detail::max_uint32), std::uint32_t, std::uint64_t > > > smallest_unsigned_integer_for
Calculates the smallest unsigned integer type that can be used to hold values up to and including Max...
Definition smallest_integer_for.hpp:38
typename constraints_impl::constraints< EnableIfs... >::type constraints
Helper used to express template constraints in a consistent way using std::enable_if_t.
Definition constraints.hpp:51
Definition accumulate.hpp:36
::size_t size_t
A type suitable for holding the size of an object.
Definition cstddef.hpp:29
bool_constant< true > true_type
An alias for bool_constant<true>
Definition integral_constant.hpp:76
Provides a backport of the constexpr implementation of std::reverse_iterator .