Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
map_reference.hpp
Go to the documentation of this file.
1// parasoft-begin-suppress AUTOSAR-A2_8_1-a-2 "inline_container/map_reference.hpp is clear enough for
2// inline_map_reference and const_inline_map_reference"
3
4// Copyright 2026, Toyota Motor Corporation
5//
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7
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_
10
11// parasoft-begin-suppress AUTOSAR-A16_2_2-a-2 "Arene Base aggregate headers permitted by A16-2-2 Permit #1"
12#include "arene/base/constraints/constraints.hpp"
13#include "arene/base/detail/exceptions.hpp"
14#include "arene/base/functional/function_traits.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" // IWYU pragma: keep
18#include "arene/base/inline_container/detail/range_interface.hpp"
19#include "arene/base/inline_container/map.hpp"
20#include "arene/base/inline_container/map_reference_iterator.hpp"
21#include "arene/base/iterator/reverse_iterator.hpp"
22#include "arene/base/stdlib_choice/cstddef.hpp"
23#include "arene/base/stdlib_choice/enable_if.hpp"
24#include "arene/base/stdlib_choice/is_copy_constructible.hpp"
25#include "arene/base/stdlib_choice/is_same.hpp"
26#include "arene/base/stdlib_choice/pair.hpp"
27#include "arene/base/type_manipulation/smallest_integer_for.hpp"
28// parasoft-end-suppress AUTOSAR-A16_2_2-a-2
29
30// parasoft-begin-suppress CERT_C-EXP37-b "False positive: The rule does not mention naming all parameters"
31// parasoft-begin-suppress AUTOSAR-A7_1_5-a "Trailing return syntax permitted by A7-1-5 Permit #1 v1.0.0"
32// parasoft-begin-suppress CERT_C-EXP37-a "False positive: The rule does not mention naming all parameters"
33// parasoft-begin-suppress AUTOSAR-M2_10_1-a-2 "Similar names permitted by M2-10-1 Permit #1"
34
35namespace arene {
36namespace base {
37namespace inline_map_reference_detail {
38
39/// @brief determine if a comparison is @c noexcept
40/// @tparam Key key type of a map
41/// @tparam Compare compare type of a map
42///
43template <class Key, class Compare>
44extern constexpr bool comparison_is_noexcept_v{inline_container::detail::compare_wrapper<Compare, Key>::
45 template comparison_is_noexcept<Key>};
46/// @brief alias for a non-const iterator
47/// @tparam MapBase associated @c inline_map_base type
48///
49template <class MapBase>
50using iterator = inline_map_reference_iterator<MapBase, false>;
51
52/// @brief alias for a const iterator
53/// @tparam MapBase associated @c inline_map_base type
54///
55template <class MapBase>
56using const_iterator = inline_map_reference_iterator<MapBase, true>;
57
58/// @brief function pointers to dispatch to const member functions
59/// @tparam MapBase associated @c inline_map_base type
60///
61template <class MapBase>
62struct const_operations {
63 /// @brief type of the capacity-erased function
64 /// @tparam R function return type
65 /// @tparam Ts function argument types, excluding the map base
66 ///
67 template <class R, class... Ts>
68 using erased_op_type = auto (*)(MapBase const*, Ts...) -> R;
69
70 /// @brief The function pointer of the key_comp operation
71 erased_op_type<typename MapBase::compare_type> key_comp;
72 /// @brief The function pointer of the size operation
73 erased_op_type<typename MapBase::size_type> size;
74 /// @brief The function pointer of the capacity operation
75 erased_op_type<typename MapBase::size_type> capacity;
76 /// @brief The function pointer of the capacity operation
77 erased_op_type<typename MapBase::size_type> max_size;
78 /// @brief The function pointer of the find operation
79 erased_op_type<const_iterator<MapBase>, typename MapBase::key_type const&> find;
80 /// @brief The function pointer of the contains operation
81 erased_op_type<bool, typename MapBase::key_type const&> contains;
82 /// @brief The function pointer of the count operation
83 erased_op_type<typename MapBase::size_type, typename MapBase::key_type const&> count;
84 /// @brief The function pointer of the lower_bound operation
85 erased_op_type<const_iterator<MapBase>, typename MapBase::key_type const&> lower_bound;
86 /// @brief The function pointer of the upper_bound operation
87 erased_op_type<const_iterator<MapBase>, typename MapBase::key_type const&> upper_bound;
88 /// @brief The function pointer of the equal_range operation
89 erased_op_type<std::pair<const_iterator<MapBase>, const_iterator<MapBase>>, typename MapBase::key_type const&>
90 equal_range;
91 /// @brief The function pointer of the at operation
92 erased_op_type<typename MapBase::mapped_type const&, typename MapBase::key_type const&> at;
93 /// @brief The function pointer of the begin operation
94 erased_op_type<const_iterator<MapBase>> begin;
95 /// @brief The function pointer of the end operation
96 erased_op_type<const_iterator<MapBase>> end;
97};
98
99/// @brief function pointers to dispatch to non-const member functions
100/// @tparam MapBase associated @c inline_map_base type
101///
102template <class MapBase>
103struct operations {
104 /// @brief type of the capacity-erased function
105 /// @tparam R function return type
106 /// @tparam Ts function argument types, excluding the map base
107 ///
108 template <class R, class... Ts>
109 using erased_op_type = auto (*)(MapBase*, Ts...) -> R;
110
111 /// @brief pointer to the const operations associated with this set of
112 /// non-const operations
113 const_operations<MapBase> const* const_ops;
114 /// @brief The function pointer of the find operation
115 erased_op_type<iterator<MapBase>, typename MapBase::key_type const&> find;
116 /// @brief The function pointer of the lower_bound operation
117 erased_op_type<iterator<MapBase>, typename MapBase::key_type const&> lower_bound;
118 /// @brief The function pointer of the upper_bound operation
119 erased_op_type<iterator<MapBase>, typename MapBase::key_type const&> upper_bound;
120 /// @brief The function pointer of the equal_range operation
121 erased_op_type<std::pair<iterator<MapBase>, iterator<MapBase>>, typename MapBase::key_type const&> equal_range;
122 /// @brief The function pointer of the operator[] operation
123 erased_op_type<typename MapBase::mapped_type&, typename MapBase::key_type const&> operator_index;
124 /// @brief The function pointer of the at operation
125 erased_op_type<typename MapBase::mapped_type&, typename MapBase::key_type const&> at;
126 /// @brief The function pointer of the insert operation
127 erased_op_type<std::pair<iterator<MapBase>, bool>, typename MapBase::value_type const&> insert;
128 /// @brief The function pointer of the insert_or_assign operation
129 erased_op_type<
130 std::pair<iterator<MapBase>, bool>,
131 typename MapBase::key_type const&,
132 typename MapBase::mapped_type const&>
133 insert_or_assign;
134 /// @brief The function pointer of the erase operation, key overload
135 erased_op_type<iterator<MapBase>, typename MapBase::key_type const&> erase_key;
136 /// @brief The function pointer of the erase operation, iterator overload
137 erased_op_type<iterator<MapBase>, const_iterator<MapBase>> erase_pos;
138 /// @brief The function pointer of the erase operation, range overload
139 erased_op_type<iterator<MapBase>, const_iterator<MapBase>, const_iterator<MapBase>> erase_rng;
140 /// @brief The function pointer of the clear operation
141 erased_op_type<void> clear;
142 /// @brief The function pointer of the begin operation
143 erased_op_type<iterator<MapBase>> begin;
144 /// @brief The function pointer of the end operation
145 erased_op_type<iterator<MapBase>> end;
146};
147
148/// @brief "alias" to a capacity-erased member function helper
149/// @tparam MemFn member function pointer of the non-erased container type
150/// @tparam Func pointer to the member function
151/// @tparam Return return type of this helper, defaults to @c member_function_return_t<MemFn>
152///
153template <class MemFn, MemFn Func, class Return = member_function_return_t<MemFn>>
154extern constexpr auto erased_member_function = inline_container::detail::erased_member_function<MemFn, Func, Return>;
155
156/// @brief capacity-erased function that returns a compile-time constant
157/// @tparam Map The associated @c inline_map type (used to deduce @c MapBase)
158/// @tparam T the type of the constant
159/// @tparam Value the compile-time constant to return
160/// @tparam MapBase deduced template param used to simplify definition
161/// @return Value
162template <class Map, class T, T Value, class MapBase = inline_container::detail::container_base_type_t<Map>>
163auto erased_integral_constant_function(MapBase const*) noexcept -> T {
164 return Value;
165}
166
167/// @brief function pointers to dispatch to const member functions
168/// @tparam Map The associated @c inline_map type
169/// @tparam MapBase deduced template param used to simplify definition
170/// @tparam ComparisonIsNoexcept deduced template param used to simplify definition
171///
172/// Collection of member function pointers for a given instance of @c
173/// inline_map. Member function pointers are transformed to replace the implicit
174/// @c this parameter with a pointer to @c MapBase. Member function pointers
175/// that return an @c inline_map specific iterator type are also transformed to
176/// return a @c map_reference_iterator instead.
177///
178/// @note Older versions of GCC (e.g. GCC8) require the exact @c noexcept
179/// qualifier for the pointer to member function type. More recent versions
180/// may omit the @c noexcept qualifier and rely on an implicit conversion of
181/// a @c noexcept(true) function to a @c noexcept(false) function.
182///
183template <
184 class Map,
185 class MapBase = inline_container::detail::container_base_type_t<Map>,
186 bool ComparisonIsNoexcept = comparison_is_noexcept_v<typename Map::key_type, typename Map::compare_type>>
187extern constexpr auto const_map_operations_with_at = const_operations<MapBase>{
188 erased_member_function<decltype(&Map::key_comp), &Map::key_comp>,
189 erased_member_function<decltype(&Map::size), &Map::size>,
190 &erased_integral_constant_function<Map, std::size_t, Map::capacity>,
191 &erased_integral_constant_function<Map, std::size_t, Map::max_size>,
192 erased_member_function<
193 auto (Map::*)(typename Map::key_type const&) const noexcept(ComparisonIsNoexcept)->typename Map::const_iterator,
194 &Map::find,
195 const_iterator<MapBase>>,
196 erased_member_function<
197 auto (Map::*)(typename Map::key_type const&) const noexcept(ComparisonIsNoexcept)->bool,
198 &Map::contains>,
199 erased_member_function<
200 auto (Map::*)(typename Map::key_type const&) const noexcept(ComparisonIsNoexcept)->typename Map::size_type,
201 &Map::count>,
202 erased_member_function<
203 auto (Map::*)(typename Map::key_type const&) const noexcept(ComparisonIsNoexcept)->typename Map::const_iterator,
204 &Map::lower_bound,
205 const_iterator<MapBase>>,
206 erased_member_function<
207 auto (Map::*)(typename Map::key_type const&) const noexcept(ComparisonIsNoexcept)->typename Map::const_iterator,
208 &Map::upper_bound,
209 const_iterator<MapBase>>,
210 erased_member_function<
211 auto (Map::*)(typename Map::key_type const&) const noexcept(ComparisonIsNoexcept)
212 ->std::pair<typename Map::const_iterator, typename Map::const_iterator>,
213 &Map::equal_range,
214 std::pair<const_iterator<MapBase>, const_iterator<MapBase>>>,
215 erased_member_function<
216 auto (Map::*)(typename Map::key_type const&) const noexcept(false)->typename Map::mapped_type const&,
217 &Map::at>,
218 erased_member_function<decltype(&Map::cbegin), &Map::begin, const_iterator<MapBase>>,
219 erased_member_function<decltype(&Map::cend), &Map::end, const_iterator<MapBase>>
220};
221
222/// @brief function pointers to dispatch to const member functions
223/// @tparam Map The associated @c inline_map type
224/// @tparam MapBase deduced template param used to simplify definition
225/// @tparam ComparisonIsNoexcept deduced template param used to simplify definition
226///
227/// Collection of member function pointers for a given instance of @c
228/// inline_map. Member function pointers are transformed to replace the implicit
229/// @c this parameter with a pointer to @c MapBase. Member function pointers
230/// that return an @c inline_map specific iterator type are also transformed to
231/// return a @c map_reference_iterator instead.
232///
233/// @note Older versions of GCC (e.g. GCC8) require the exact @c noexcept
234/// qualifier for the pointer to member function type. More recent versions
235/// may omit the @c noexcept qualifier and rely on an implicit conversion of
236/// a @c noexcept(true) function to a @c noexcept(false) function.
237///
238template <
239 class Map,
240 class MapBase = inline_container::detail::container_base_type_t<Map>,
241 bool ComparisonIsNoexcept = comparison_is_noexcept_v<typename Map::key_type, typename Map::compare_type>>
242extern constexpr auto const_map_operations_without_at = const_operations<MapBase>{
243 erased_member_function<decltype(&Map::key_comp), &Map::key_comp>,
244 erased_member_function<decltype(&Map::size), &Map::size>,
245 &erased_integral_constant_function<Map, std::size_t, Map::capacity>,
246 &erased_integral_constant_function<Map, std::size_t, Map::max_size>,
247 erased_member_function<
248 auto (Map::*)(typename Map::key_type const&) const noexcept(ComparisonIsNoexcept)->typename Map::const_iterator,
249 &Map::find,
250 const_iterator<MapBase>>,
251 erased_member_function<
252 auto (Map::*)(typename Map::key_type const&) const noexcept(ComparisonIsNoexcept)->bool,
253 &Map::contains>,
254 erased_member_function<
255 auto (Map::*)(typename Map::key_type const&) const noexcept(ComparisonIsNoexcept)->typename Map::size_type,
256 &Map::count>,
257 erased_member_function<
258 auto (Map::*)(typename Map::key_type const&) const noexcept(ComparisonIsNoexcept)->typename Map::const_iterator,
259 &Map::lower_bound,
260 const_iterator<MapBase>>,
261 erased_member_function<
262 auto (Map::*)(typename Map::key_type const&) const noexcept(ComparisonIsNoexcept)->typename Map::const_iterator,
263 &Map::upper_bound,
264 const_iterator<MapBase>>,
265 erased_member_function<
266 auto (Map::*)(typename Map::key_type const&) const noexcept(ComparisonIsNoexcept)
267 ->std::pair<typename Map::const_iterator, typename Map::const_iterator>,
268 &Map::equal_range,
269 std::pair<const_iterator<MapBase>, const_iterator<MapBase>>>,
270 nullptr, // this is &Map::at, which does not exist (and is removed from map_reference by SFINAE)
271 erased_member_function<decltype(&Map::cbegin), &Map::begin, const_iterator<MapBase>>,
272 erased_member_function<decltype(&Map::cend), &Map::end, const_iterator<MapBase>>
273};
274
275/// @brief capacity-erased helper for @c inline_map::erase overloads
276/// @tparam Map The associated @c inline_map type
277/// @tparam MapBase deduced template param used to simplify definition
278///
279/// Helper type that provides functions to call @c inline_map::erase with
280/// iterator arguments.
281///
282template <class Map, class MapBase = inline_container::detail::container_base_type_t<Map>>
283class erase_fn_iterator_argument_adaptor : inline_map_detail::inline_map_passkey_base<MapBase> {
284 /// @brief convert a capacity-erased iterator to an @c inline_map::const_iterator
285 /// @param iter capacity-erased iterator
286 /// @return @c inline_map::const_iterator to the same position in the map
287 ///
288 static auto restored(const_iterator<MapBase> iter) noexcept -> typename Map::const_iterator {
289 using index_type = smallest_unsigned_integer_for<Map::capacity>;
290
291 constexpr auto passkey = typename inline_map_detail::inline_map_passkey_base<MapBase>::inline_map_passkey{};
292
293 return typename Map::const_iterator{
294 passkey,
295 static_cast<Map const*>(iter.get_map(passkey)),
296 static_cast<index_type>(iter.get_index(passkey))
297 };
298 }
299
300 /// @brief obtain the associated @c inline_map
301 /// @param map pointer to a map base
302 /// @return reference to an @c inline_map
303 ///
304 static auto derived(MapBase* map) noexcept -> Map& { return *static_cast<Map*>(map); }
305
306 public:
307 /// @brief erase an element in a map
308 /// @param map pointer to a map base
309 /// @param pos capacity-erased iterator specifying a position in @c map
310 /// @pre @c pos is a dereferencable iterator of @c map
311 /// @return capacity-erased iterator specifying the position after the removed
312 /// element
313 ///
314 static auto one_argument_overload(MapBase* map, const_iterator<MapBase> pos) noexcept -> iterator<MapBase> {
315 return iterator<MapBase>{derived(map).erase(restored(pos))};
316 }
317
318 /// @brief erase elements in a map
319 /// @param map pointer to a map base
320 /// @param first beginning of the range of elements to remove
321 /// @param last end of the range of elements to remove
322 /// @pre <tt> [first, last) </tt> is a valid range in @c map
323 /// @return capacity-erased iterator specifying the position after the removed
324 /// elements
325 ///
326 static auto two_argument_overload(MapBase* map, const_iterator<MapBase> first, const_iterator<MapBase> last) noexcept
327 -> iterator<MapBase> {
328 return iterator<MapBase>{derived(map).erase(restored(first), restored(last))};
329 }
330};
331
332/// @brief function pointers to dispatch to non-const member functions
333/// @tparam Map The associated @c inline_map type
334/// @tparam MapBase deduced template param used to simplify definition
335/// @tparam ComparisonIsNoexcept deduced template param used to simplify definition
336///
337/// Collection of member function pointers for a given instance of @c
338/// inline_map. Member function pointers are transformed to replace the implicit
339/// @c this parameter with a pointer to @c MapBase. Member function pointers
340/// that return an @c inline_map specific iterator type are also transformed to
341/// return a @c map_reference_iterator instead.
342///
343/// @note Older versions of GCC (e.g. GCC8) require the exact @c noexcept
344/// qualifier for the pointer to member function type. More recent versions
345/// may omit the @c noexcept qualifier and rely on an implicit conversion of
346/// a @c noexcept(true) function to a @c noexcept(false) function.
347///
348template <
349 class Map,
350 class MapBase = inline_container::detail::container_base_type_t<Map>,
351 bool ComparisonIsNoexcept = comparison_is_noexcept_v<typename Map::key_type, typename Map::compare_type>>
352extern constexpr auto map_operations_with_at = operations<MapBase> {
353 &const_map_operations_with_at<Map>,
354 erased_member_function<
355 auto (Map::*)(typename Map::key_type const&) noexcept(ComparisonIsNoexcept)->typename Map::iterator,
356 &Map::find,
357 iterator<MapBase>>,
358 erased_member_function<
359 auto (Map::*)(typename Map::key_type const&) noexcept(ComparisonIsNoexcept)->typename Map::iterator,
360 &Map::lower_bound,
361 iterator<MapBase>>,
362 erased_member_function<
363 auto (Map::*)(typename Map::key_type const&) noexcept(ComparisonIsNoexcept)->typename Map::iterator,
364 &Map::upper_bound,
365 iterator<MapBase>>,
366 erased_member_function<
367 auto (Map::*)(typename Map::key_type const&) noexcept(ComparisonIsNoexcept)
368 ->std::pair<typename Map::iterator, typename Map::iterator>,
369 &Map::equal_range,
370 std::pair<iterator<MapBase>, iterator<MapBase>>>,
371 erased_member_function < auto (Map::*)(typename Map::key_type const&) noexcept(false)->typename Map::mapped_type&,
372 &Map::operator[]>,
373 erased_member_function<
374 auto (Map::*)(typename Map::key_type const&) noexcept(false)->typename Map::mapped_type&,
375 &Map::at>,
376 erased_member_function<
377 auto (Map::*)(typename Map::value_type const&) noexcept(false)->std::pair<typename Map::iterator, bool>,
378 &Map::insert,
379 std::pair<iterator<MapBase>, bool>>,
380 erased_member_function<
381 auto (Map::*)(typename Map::key_type const&, typename Map::mapped_type const&) noexcept(false)
382 ->std::pair<typename Map::iterator, bool>,
383 &Map::insert_or_assign,
384 std::pair<iterator<MapBase>, bool>>,
385 erased_member_function<
386 auto (Map::*)(typename Map::key_type const&) noexcept(ComparisonIsNoexcept)->typename Map::iterator,
387 &Map::erase,
388 iterator<MapBase>>,
389 &erase_fn_iterator_argument_adaptor<Map>::one_argument_overload,
390 &erase_fn_iterator_argument_adaptor<Map>::two_argument_overload,
391 erased_member_function<decltype(&Map::clear), &Map::clear>,
392 erased_member_function<auto (Map::*)() noexcept -> typename Map::iterator, &Map::begin, iterator<MapBase>>,
393 erased_member_function<auto (Map::*)() noexcept -> typename Map::iterator, &Map::end, iterator<MapBase>>
394};
395
396/// @brief function pointers to dispatch to non-const member functions
397/// @tparam Map The associated @c inline_map type
398/// @tparam MapBase deduced template param used to simplify definition
399/// @tparam ComparisonIsNoexcept deduced template param used to simplify definition
400///
401/// Collection of member function pointers for a given instance of @c
402/// inline_map. Member function pointers are transformed to replace the implicit
403/// @c this parameter with a pointer to @c MapBase. Member function pointers
404/// that return an @c inline_map specific iterator type are also transformed to
405/// return a @c map_reference_iterator instead.
406///
407/// @note Older versions of GCC (e.g. GCC8) require the exact @c noexcept
408/// qualifier for the pointer to member function type. More recent versions
409/// may omit the @c noexcept qualifier and rely on an implicit conversion of
410/// a @c noexcept(true) function to a @c noexcept(false) function.
411///
412template <
413 class Map,
414 class MapBase = inline_container::detail::container_base_type_t<Map>,
415 bool ComparisonIsNoexcept = comparison_is_noexcept_v<typename Map::key_type, typename Map::compare_type>>
416extern constexpr auto map_operations_without_at = operations<MapBase> {
417 &const_map_operations_without_at<Map>,
418 erased_member_function<
419 auto (Map::*)(typename Map::key_type const&) noexcept(ComparisonIsNoexcept)->typename Map::iterator,
420 &Map::find,
421 iterator<MapBase>>,
422 erased_member_function<
423 auto (Map::*)(typename Map::key_type const&) noexcept(ComparisonIsNoexcept)->typename Map::iterator,
424 &Map::lower_bound,
425 iterator<MapBase>>,
426 erased_member_function<
427 auto (Map::*)(typename Map::key_type const&) noexcept(ComparisonIsNoexcept)->typename Map::iterator,
428 &Map::upper_bound,
429 iterator<MapBase>>,
430 erased_member_function<
431 auto (Map::*)(typename Map::key_type const&) noexcept(ComparisonIsNoexcept)
432 ->std::pair<typename Map::iterator, typename Map::iterator>,
433 &Map::equal_range,
434 std::pair<iterator<MapBase>, iterator<MapBase>>>,
435 erased_member_function < auto (Map::*)(typename Map::key_type const&) noexcept(false)->typename Map::mapped_type&,
436 &Map::operator[]>,
437 nullptr, // this is &Map::at, which does not exist (and is removed from map_reference by SFINAE)
438 erased_member_function<
439 auto (Map::*)(typename Map::value_type const&) noexcept(false)->std::pair<typename Map::iterator, bool>,
440 &Map::insert,
441 std::pair<iterator<MapBase>, bool>>,
442 erased_member_function<
443 auto (Map::*)(typename Map::key_type const&, typename Map::mapped_type const&) noexcept(false)
444 ->std::pair<typename Map::iterator, bool>,
445 &Map::insert_or_assign,
446 std::pair<iterator<MapBase>, bool>>,
447 erased_member_function<
448 auto (Map::*)(typename Map::key_type const&) noexcept(ComparisonIsNoexcept)->typename Map::iterator,
449 &Map::erase,
450 iterator<MapBase>>,
451 &erase_fn_iterator_argument_adaptor<Map>::one_argument_overload,
452 &erase_fn_iterator_argument_adaptor<Map>::two_argument_overload,
453 erased_member_function<decltype(&Map::clear), &Map::clear>,
454 erased_member_function<auto (Map::*)() noexcept -> typename Map::iterator, &Map::begin, iterator<MapBase>>,
455 erased_member_function<auto (Map::*)() noexcept -> typename Map::iterator, &Map::end, iterator<MapBase>>
456};
457
458/// @brief CRTP helper providing const member functions
459/// @tparam Derived @c const_inline_map_reference or @c inline_map_reference
460///
461template <class Derived>
462class const_inline_map_reference_interface {
463 /// @brief downcast
464 /// @return reference to @c**this as the derived type
465 ///
466 auto derived() const noexcept -> Derived const& { return static_cast<Derived const&>(*this); }
467
468 /// @brief obtain a pointer to the capacity-erased map
469 /// @tparam D type that is always intended to be @c Derived
470 /// @return map base type pointer
471 ///
472 template <class D>
473 auto map() const noexcept -> typename D::map_base_type const* {
474 return derived().map_ptr();
475 }
476
477 /// @brief obtain the capacity-erased operations
478 /// @tparam D type that is always intended to be @c Derived
479 /// @return reference to capacity-erased operations
480 ///
481 template <class D>
482 auto ops() const noexcept -> const_operations<typename D::map_base_type> const& {
483 return *derived().const_ops_ptr();
484 }
485
486 /// @brief determine if comparison is @c noexcept
487 /// @tparam D type that is always intended to be @c Derived
488 ///
489 template <class D>
490 static constexpr bool comparison_is_noexcept{inline_map_reference_detail::comparison_is_noexcept_v<
491 typename D::key_type,
492 typename D::compare_type>};
493
494 protected:
495 /// @brief constructor
496 /// @tparam Actual tag type, intended to always be @c Derived
497 /// @tparam Expected deduced template parameter, defined to improve compiler
498 /// error messages
499 ///
500 /// Construct a 'const_inline_map_reference_interface' CRTP helper type. Intended to be invoked as:
501 /// ~~~{.cpp}
502 /// const_inline_map_reference_interface{this}
503 /// ~~~
504 ///
505 /// This constructor exists to prevent use by a type that does _not_ define
506 /// 'const_inline_map_reference_interface' as a CRTP base class or to detect
507 /// mismatch between the actual derived type and the @c Derived template
508 /// parameter.
509 ///
510 template <class Actual, class Expected = Derived>
511 explicit const_inline_map_reference_interface(Actual*) noexcept {
512 static_assert(
513 std::is_same<Actual, Expected>::value,
514 "'Derived' type mismatch.\n" //
515 "Please verify that 'Derived' is defined correctly when using 'const_inline_map_reference_interface' as a CRTP "
516 "base."
517 );
518 }
519 /// @brief default destructor
520 ~const_inline_map_reference_interface() = default;
521 /// @brief default copy constructor
522 const_inline_map_reference_interface(const_inline_map_reference_interface const&) = default;
523 /// @brief default move constructor
524 const_inline_map_reference_interface(const_inline_map_reference_interface&&) = default;
525 /// @brief default copy assignment operator
526 auto operator=(const_inline_map_reference_interface const&) -> const_inline_map_reference_interface& = default;
527 /// @brief default move assignment operator
528 auto operator=(const_inline_map_reference_interface&&) -> const_inline_map_reference_interface& = default;
529
530 public:
531 /// @brief Obtain a copy of the comparator
532 /// @return The comparator
533 template <class D = Derived>
534 auto key_comp() const noexcept(std::is_nothrow_copy_constructible<typename D::compare_type>::value)
535 -> decltype(ops<D>().key_comp(map<D>())) {
536 return ops<D>().key_comp(map<D>());
537 }
538
539 /// @brief Get the current number of elements in the map
540 /// @return the size
541 template <class D = Derived>
542 auto size() const noexcept -> decltype(ops<D>().size(map<D>())) {
543 return ops<D>().size(map<D>());
544 }
545
546 /// @brief Get the element capacity of the map
547 /// @return the capacity
548 template <class D = Derived>
549 auto capacity() const noexcept -> decltype(ops<D>().capacity(map<D>())) {
550 return ops<D>().capacity(map<D>());
551 }
552
553 /// @brief Get the max size of the map
554 /// @return the max size
555 template <class D = Derived>
556 auto max_size() const noexcept -> decltype(ops<D>().max_size(map<D>())) {
557 return ops<D>().max_size(map<D>());
558 }
559
560 /// @brief Obtain an iterator referring to the element equivalent to the supplied key, if there is one.
561 /// @param key The key to find
562 /// @return iterator to the equivalent element, or @c end() if the element is not found
563 template <class D = Derived>
564 auto find(typename D::key_type const& key) const noexcept(comparison_is_noexcept<D>)
565 -> decltype(ops<D>().find(map<D>(), key)) {
566 return ops<D>().find(map<D>(), key);
567 }
568
569 /// @brief Check if the set contains a specific key
570 /// @param key The key to search for
571 /// @return true if @c find(key)!=end() .
572 /// @return false if @c find(key)==end() .
573 template <class D = Derived>
574 auto contains(typename D::key_type const& key) const noexcept(comparison_is_noexcept<D>)
575 -> decltype(ops<D>().contains(map<D>(), key)) {
576 return ops<D>().contains(map<D>(), key);
577 }
578
579 /// @brief Return the number of elements in the map equivalent to a specific key.
580 ///
581 /// @param key The key to search for.
582 /// @return std::size_t @c 0 if the element was not in the map, else @c 1 .
583 template <class D = Derived>
584 auto count(typename D::key_type const& key) const noexcept(comparison_is_noexcept<D>)
585 -> decltype(ops<D>().count(map<D>(), key)) {
586 return ops<D>().count(map<D>(), key);
587 }
588
589 /// @brief Find the first element which is _not less than_ a given key.
590 ///
591 /// @param key The key to find the lower bound for.
592 /// @return iterator to the first element which is _not less than_ @c key , or @c end() if there is no
593 /// such element.
594 template <class D = Derived>
595 auto lower_bound(typename D::key_type const& key) const noexcept(comparison_is_noexcept<D>)
596 -> decltype(ops<D>().lower_bound(map<D>(), key)) {
597 return ops<D>().lower_bound(map<D>(), key);
598 }
599
600 /// @brief Find the first element which is _not less than_ a given key.
601 ///
602 /// @param key The key to find the lower bound for.
603 /// @return const_iterator to the first element which is _not less than_ @c key , or @c end() if there is no
604 /// such element.
605 template <class D = Derived>
606 auto upper_bound(typename D::key_type const& key) const noexcept(comparison_is_noexcept<D>)
607 -> decltype(ops<D>().upper_bound(map<D>(), key)) {
608 return ops<D>().upper_bound(map<D>(), key);
609 }
610
611 /// @brief Finds the sequence of elements whose keys compare equivalent to a given key.
612 ///
613 /// @param key The key to search for
614 /// @return std::pair<iterator, iterator> A pair of iterators such that all elements in the range @c [first,second)
615 /// have keys which compare equal to @c key if there was a key equivalent to @c key in the map. Otherwise both
616 /// iterators will be @c end() .
617 template <class D = Derived>
618 auto equal_range(typename D::key_type const& key) const noexcept(comparison_is_noexcept<D>)
619 -> decltype(ops<D>().equal_range(map<D>(), key)) {
620 return ops<D>().equal_range(map<D>(), key);
621 }
622
623 /// @brief Obtain a reference to the mapped value for the specified key or throw.
624 ///
625 /// @param key The key to obtain the value for
626 /// @return Value& A reference to the mapped value
627 /// @throws std::out_of_range if @c find(key)==end() .
628 /// @throws Any exception thrown by the comparisons
629 template <
630 class D = Derived,
631 bool AreExceptionsEnabled = detail::are_exceptions_enabled::value,
632 constraints<std::enable_if_t<AreExceptionsEnabled>> = nullptr>
633 auto at(typename D::key_type const& key) const noexcept(false) -> decltype(ops<D>().at(map<D>(), key)) {
634 return ops<D>().at(map<D>(), key);
635 }
636
637 /// @brief Obtain an iterator referring to the beginning of the sorted range of elements.
638 /// @return iterator Points to the first element in the sequence, or @c end() if @c empty() .
639 template <class D = Derived>
640 auto begin() const noexcept -> decltype(ops<D>().begin(map<D>())) {
641 return ops<D>().begin(map<D>());
642 }
643
644 /// @brief Obtain an iterator referring to one past the last element in the sorted range of elements.
645 /// @return iterator An iterator pointing to one past the last element in the sequence.
646 template <class D = Derived>
647 auto end() const noexcept -> decltype(ops<D>().end(map<D>())) {
648 return ops<D>().end(map<D>());
649 }
650};
651
652} // namespace inline_map_reference_detail
653
654// parasoft-begin-suppress AUTOSAR-A10_2_1-a "Hiding members of the interface
655// base (e.g. 'begin') does not 'defeat polymorphism by causing an object to
656// behave differently depending on which interface is used to manipulate it.' No
657// functions are virtual and this is no different than selecting a const or
658// non-const member function based on the const-ness of an object."
659
660// parasoft-begin-suppress AUTOSAR-A10_2_1-b "Hiding members of the interface
661// base (e.g. 'begin') does not 'defeat polymorphism by causing an object to
662// behave differently depending on which interface is used to manipulate it.' No
663// functions are virtual and this is no different than selecting a const or
664// non-const member function based on the const-ness of an object."
665
666// parasoft-begin-suppress AUTOSAR-A12_1_5-a "False positive: there is no
667// common class initialization betweeen two constructors where one is deleted"
668
669// parasoft-begin-suppress AUTOSAR-A13_5_1-a "False positive:" rule specifies
670// that a const overload of 'operator[]' is required if a non-const overload of
671// 'operator[]' is defined. This class only defines a const overload."
672
673// parasoft-begin-suppress AUTOSAR-A10_1_1-a-2 "False positive: Only inherits from interface base classes"
674
675/// @brief A reference class to an inline_map object, with size-erased type
676/// @tparam Key The key type for the map
677/// @tparam Value The mapped type for the map
678/// @tparam Compare The comparison function
679/// @pre The comparison must provide a strict ordering over the values of @c Key
680///
681template <class Key, class Value, class Compare>
683 : public inline_map_reference_detail::const_inline_map_reference_interface<
684 inline_map_reference<Key, Value, Compare>>
686 public:
687 /// @brief alias to the map base class
689
690 /// @brief alias to const operations type
692
693 /// @brief alias to non-const operations type
695
696 /// @brief key type of the map
697 using key_type = Key;
698 /// @brief mapped type of the map
699 using mapped_type = Value;
700 /// @brief value type of the map
701 using value_type = std::pair<Key const, Value>;
702 /// @brief size type of the map
704 /// @brief iterator type of a reference to the map
706 /// @brief const iterator type of the underlying map
708 /// @brief The type of an iterator that provides non- @c const access to the elements
709 /// and iterates in reverse through the elements
711 /// @brief The type of an iterator that provides @c const access to the elements
712 /// and iterates in reverse through the elements
714 /// @brief compare type of the map
715 using compare_type = Compare;
716
717 private:
718 /// @brief alias to the interface class providing const member functions
719 using interface_base = inline_map_reference_detail::const_inline_map_reference_interface<inline_map_reference>;
720
721 /// @brief alias to the range interface class providing range member functions
723
724 /// @brief pointer to the base class
725 map_base_type* map_ptr_;
726
727 /// @brief pointer to const operations
728 ops_type const* ops_ptr_;
729
730 // parasoft-begin-suppress AUTOSAR-A2_10_1-e "False positive: identifier
731 // 'comparison_is_noexcept' in the base type is not hidden, it is private"
732
733 /// @brief determine if comparison is @c noexcept
734 static constexpr bool comparison_is_noexcept{inline_container::detail::compare_wrapper<Compare, Key>::
735 template comparison_is_noexcept<Key>};
736 // parasoft-end-suppress AUTOSAR-A2_10_1-e
737
738 public:
739 /// @brief obtain a pointer to the map base
740 /// @return pointer to the map base
741 ///
742 auto map_ptr() const noexcept -> map_base_type* { return map_ptr_; }
743
744 /// @brief obtain a pointer to the non-const operations
745 /// @return pointer to the non-const operations
746 ///
747 auto ops_ptr() const noexcept -> ops_type const* { return ops_ptr_; }
748
749 /// @brief obtain a pointer to the const operations
750 /// @return pointer to the const operations
751 ///
752 auto const_ops_ptr() const noexcept -> const_ops_type const* { return ops_ptr()->const_ops; }
753
754 /// @brief construct an @c inline_map_reference of a map
755 /// @tparam Capacity capacity of the @c inline_map
756 /// @param map @c inline_map to reference
757 ///
758 template <
767
768 /// @brief construct an @c inline_map_reference of a map
769 /// @tparam Capacity capacity of the @c inline_map
770 /// @param map @c inline_map to reference
771 ///
772 template <
781
782 /// @brief construct an @c inline_map_reference of a map
783 /// @tparam Capacity capacity of the @c inline_map
784 ///
785 /// Deleted overload for rvalue references.
786 ///
787 template <std::size_t Capacity>
788 explicit inline_map_reference(inline_map<Key, Value, Capacity, Compare> const&&) = delete;
789
790 /// @brief obtain an iterator to the first element with a given key
791 /// @param key the key to search for
792 /// @return iterator to the first element equal to @c key, or @c end() if the
793 /// element is not found
794 ///
795 auto find(key_type const& key) const noexcept(comparison_is_noexcept) -> decltype(ops_ptr_->find(map_ptr_, key)) {
796 return ops_ptr_->find(map_ptr_, key);
797 }
798
799 /// @brief find the first element which is _not less than_ a given key
800 /// @param key the key to search for
801 /// @return iterator to the first element which is _not less than_ @c key, or
802 /// @c end() if there is no such element
803 ///
804 auto lower_bound(key_type const& key) const noexcept(comparison_is_noexcept)
805 -> decltype(ops_ptr_->lower_bound(map_ptr_, key)) {
806 return ops_ptr_->lower_bound(map_ptr_, key);
807 }
808
809 /// @brief find the first element which is _greater than_ a given key
810 /// @param key the key to search for
811 /// @return iterator to the first element which is _greater than_ @c key, or
812 /// @c end() if there is no such element
813 ///
814 auto upper_bound(key_type const& key) const noexcept(comparison_is_noexcept)
815 -> decltype(ops_ptr_->upper_bound(map_ptr_, key)) {
816 return ops_ptr_->upper_bound(map_ptr_, key);
817 }
818
819 /// @brief find the sequence of elements whose keys compare equivalent to a given key
820 /// @param key the key to search for
821 /// @return pair of iterators such that all elements in the range <tt> [first, second) </tt>
822 /// have keys which compare equal to @c key if there was a key equivalent to
823 /// @c key in the map. Otherwise both iterators will be @c end().
824 ///
825 auto equal_range(key_type const& key) const noexcept(comparison_is_noexcept)
826 -> decltype(ops_ptr_->equal_range(map_ptr_, key)) {
827 return ops_ptr_->equal_range(map_ptr_, key);
828 }
829
830 /// @brief obtain a reference to the mapped value for the specified key
831 /// @param key the key to search for
832 /// @return reference to the mapped value. If @c key did not exist in the map,
833 /// then a default constructed @c mapped_type is inserted into the map at @c
834 /// key and a reference to it is returned.
835 ///
836 /// @throws anny exception thrown by the comparisons, and exception throw by
837 /// the copy-constructor of @c key_type, or the default-constructor of
838 /// @c mapped_type
839 ///
840 /// @pre <tt> size() < Capacity </tt> if @c contains(key) is @c false
841 ///
842 auto operator[](key_type const& key) const noexcept(false) -> decltype(ops_ptr_->operator_index(map_ptr_, key)) {
843 return ops_ptr_->operator_index(map_ptr_, key);
844 }
845
846 /// @brief obtain a reference to the mapped value for the specified key
847 /// @param key the key to search for
848 /// @return reference to the mapped value
849 /// @throws std::out_of_range if @c contains(key) is @c false
850 /// @throws any exception thrown by the comparisons
851 ///
852 template <
855 auto at(key_type const& key) const noexcept(false) -> decltype(ops_ptr_->at(map_ptr_, key)) {
856 return ops_ptr_->at(map_ptr_, key);
857 }
858
859 /// @brief insert an element in the map
860 /// @param value the value to insert
861 ///
862 /// Copy constructs the provided value into the new element if an appropriate
863 /// element does not already exist.
864 ///
865 /// @return std::pair<iterator, bool> whose first element is the key
866 /// equivalent to @c value.first, and whose second element is a boolean with
867 /// a value of @c true if the element was inserted or @c false if not.
868 ///
869 /// @pre @c contains(value.first) is @c true, or <tt> size() < Capacity </tt>
870 /// of the @c inline_map
871 ///
872 /// @throws any exception thrown by the comparisons, or the copy constructor
873 /// of @c value_type
874 ///
875 auto insert(value_type const& value) const noexcept(false) -> decltype(ops_ptr_->insert(map_ptr_, value)) {
876 return ops_ptr_->insert(map_ptr_, value);
877 }
878
879 /// @brief insert an element in the map or update an existing element
880 /// @param key the key for which to insert or assign an element
881 /// @param mapped the value to associate with @c key
882 ///
883 /// If @c key is contained in the @c inline_map, updates the associated value
884 /// by copy-assigning @c mapped. If @c key is not contained in the @c
885 /// inline_map, constructs a new element in the @c inline_map by copying @c
886 /// key and @c mapped.
887 ///
888 /// @return pair containing an iterator to the element in the map and boolean
889 /// that is @c true if the element was inserted and @c false if not.
890 ///
891 /// @pre @c contains(key) is @c true, or <tt> size() < Capacity </tt> of the
892 /// @c inline_map
893 ///
894 /// @throws any exception thrown by the comparisons, the move constructor of
895 /// @c key_type or the constructor or assignment operator of @c value_type
896 ///
897 auto insert_or_assign(key_type const& key, mapped_type const& mapped) const noexcept(false)
898 -> decltype(ops_ptr_->insert_or_assign(map_ptr_, key, mapped)) {
900 }
901
902 /// @brief remove element with the corresponding key, if there is one
903 /// @param key The key to erase
904 /// @return iterator after the removed element, or @c end if there is no
905 /// element was removed
906 ///
907 auto erase(key_type const& key) const noexcept(comparison_is_noexcept)
908 -> decltype(ops_ptr_->erase_key(map_ptr_, key)) {
909 return ops_ptr_->erase_key(map_ptr_, key);
910 }
911
912 /// @brief remove the element at the specified position
913 /// @param pos iterator referring to the element to remove
914 /// @pre @c pos must be a dereferencable iterator referring to an element in @c map
915 /// @return iterator after the removed element
916 ///
917 auto erase(const_iterator pos) const noexcept -> decltype(ops_ptr_->erase_pos(map_ptr_, pos)) {
918 return ops_ptr_->erase_pos(map_ptr_, pos);
919 }
920
921 /// @brief remove elements in the specified range
922 /// @param first beginning of the range of elements to remove
923 /// @param last end of the range of elements to remove
924 /// @pre <tt> [first, last) </tt> is a valid range in @c map
925 /// @return iterator after the removed element
926 ///
928 -> decltype(ops_ptr_->erase_rng(map_ptr_, first, last)) {
930 }
931
932 /// @brief destroy all elements in the assocaited @c inline_map
933 /// @post <tt> size() == 0 </tt>
934 /// @return @c void
935 ///
936 auto clear() const noexcept -> decltype(ops_ptr_->clear(map_ptr_)) { return ops_ptr_->clear(map_ptr_); }
937
938 /// @brief obtain an iterator referring to the beginning of the sorted range of elements
939 /// @return iterator to fhe first element in the sequence, or @c end() if @c empty()
940 ///
941 auto begin() const noexcept -> decltype(ops_ptr_->begin(map_ptr_)) { return ops_ptr_->begin(map_ptr_); }
942
943 /// @brief obtain an iterator referring to one past the last element in the sorted range of elements
944 /// @return iterator one past the last element in the sequence
945 ///
946 auto end() const noexcept -> decltype(ops_ptr_->end(map_ptr_)) { return ops_ptr_->end(map_ptr_); }
947};
948
949// parasoft-end-suppress AUTOSAR-A10_1_1-a-2
950// parasoft-end-suppress AUTOSAR-A10_2_1-a
951// parasoft-end-suppress AUTOSAR-A10_2_1-b
952// parasoft-end-suppress AUTOSAR-A12_1_5-a
953// parasoft-end-suppress AUTOSAR-A13_5_1-a
954
955// parasoft-begin-suppress AUTOSAR-A12_1_5-a "Delegating constructors would not reduce duplication"
956// parasoft-begin-suppress AUTOSAR-A10_1_1-a-2 "False positive: Only inherits from interface base classes"
957
958/// @brief A const reference class to an inline_map object, with size-erased type
959/// @tparam Key The key type for the map
960/// @tparam Value The mapped type for the map
961/// @tparam Compare The comparison function
962/// @pre The comparison must provide a strict ordering over the values of @c Key
963///
964template <class Key, class Value, class Compare>
966 : public inline_map_reference_detail::const_inline_map_reference_interface<
967 const_inline_map_reference<Key, Value, Compare>>
969 public:
970 /// @brief alias to the capacity-erased map base class
972
973 /// @brief alias to const operations type
975
976 /// @brief key type of the map
977 using key_type = Key;
978 /// @brief mapped type of the map
979 using mapped_type = Value;
980 /// @brief value type of the map
981 using value_type = std::pair<Key const, Value>;
982 /// @brief size type of the map
984 /// @brief iterator type of a const reference to the map
986 /// @brief const iterator type of the underlying map
988 /// @brief The type of an iterator that provides non- @c const access to the elements
989 /// and iterates in reverse through the elements
991 /// @brief The type of an iterator that provides @c const access to the elements
992 /// and iterates in reverse through the elements
994 /// @brief compare type of the map
995 using compare_type = Compare;
996
997 private:
998 /// @brief alias to the interface class providing const member functions
999 using interface_base = inline_map_reference_detail::const_inline_map_reference_interface<const_inline_map_reference>;
1000
1001 /// @brief alias to the range interface class providing range member functions
1003
1004 /// @brief pointer to the base class
1005 map_base_type const* map_ptr_;
1006
1007 /// @brief pointer to const operations
1008 const_ops_type const* const_ops_ptr_;
1009
1010 public:
1011 /// @brief obtain a pointer to the map base
1012 /// @return pointer to the map base
1013 ///
1014 auto map_ptr() const noexcept -> map_base_type const* { return map_ptr_; }
1015
1016 /// @brief obtain a pointer to the const operations
1017 /// @return pointer to the const operations
1018 ///
1019 auto const_ops_ptr() const noexcept -> const_ops_type const* { return const_ops_ptr_; }
1020
1021 /// @brief construct a @c const_inline_map_reference of a map
1022 /// @tparam Capacity capacity of the @c inline_map
1023 /// @param map @c inline_map to reference
1024 ///
1025 template <
1035
1036 /// @brief construct a @c const_inline_map_reference of a map
1037 /// @tparam Capacity capacity of the @c inline_map
1038 /// @param map @c inline_map to reference
1039 ///
1040 template <
1050
1051 /// @brief construct a @c const_inline_map_reference of a map
1052 /// @tparam Capacity capacity of the @c inline_map
1053 ///
1054 /// Deleted overload for rvalue references.
1055 ///
1056 template <std::size_t Capacity>
1058
1059 /// @brief construct a @c const_inline_map_reference from an @c inline_map_reference
1060 /// @param other @c inline_map_reference value
1061 ///
1062 explicit const_inline_map_reference(inline_map_reference<Key, Value, Compare> other) noexcept
1063 : interface_base{this},
1064 range_base{this},
1067};
1068
1069// parasoft-end-suppress AUTOSAR-A10_1_1-a-2
1070// parasoft-end-suppress AUTOSAR-A12_1_5-a
1071
1072} // namespace base
1073} // namespace arene
1074
1075#endif // INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_INLINE_CONTAINER_MAP_REFERENCE_HPP_
A const reference class to an inline_map object, with size-erased type.
Definition map_reference.hpp:968
auto map_ptr() const noexcept -> map_base_type const *
obtain a pointer to the map base
Definition map_reference.hpp:1014
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:1062
auto const_ops_ptr() const noexcept -> const_ops_type const *
obtain a pointer to the const operations
Definition map_reference.hpp:1019
A reference class to an inline_map object, with size-erased type.
Definition map_reference.hpp:685
auto operator[](key_type const &key) const noexcept(false) ->
obtain a reference to the mapped value for the specified key
Definition map_reference.hpp:842
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:825
auto ops_ptr() const noexcept -> ops_type const *
obtain a pointer to the non-const operations
Definition map_reference.hpp:747
auto const_ops_ptr() const noexcept -> const_ops_type const *
obtain a pointer to the const operations
Definition map_reference.hpp:752
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:804
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:795
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:814
auto map_ptr() const noexcept -> map_base_type *
obtain a pointer to the map base
Definition map_reference.hpp:742
Definition array_exceptions_disabled.cpp:11
Copyright 2026, Toyota Motor Corporation.
Definition array_exceptions_disabled.cpp:10