![]() |
Arene Base
Fundamental Utilities For Safety Critical C++
|
A container similar to std::map that has a fixed capacity.
More...

Public Types | |
| using | const_iterator = iterator_impl<true> |
The type of an iterator that provides const access to the elements. | |
| using | const_pointer = value_type const* |
The type of a const pointer to the value type of the map. | |
| using | const_reference = value_type const& |
The type of a const reference to the value type of the map. | |
| using | const_reverse_iterator = ::arene::base::reverse_iterator<const_iterator> |
The type of an iterator that provides const access to the elements and iterates in reverse through the elements. | |
| using | difference_type = typename iterator::difference_type |
| The difference type of the map. | |
| using | inline_map_base_type = map_base_type |
inline_map_base type | |
| using | iterator = iterator_impl<false> |
The type of an iterator that provides non- const access to the elements. | |
| using | key_compare = typename map_base_type::compare_type |
| The comparator of the map. | |
| using | key_type = typename map_base_type::key_type |
| The key type of the map. | |
| using | mapped_type = typename map_base_type::mapped_type |
| The mapped type of the map. | |
| using | pointer = value_type* |
| The type of a pointer to the value type of the map. | |
| using | reference = value_type& |
| The type of a reference to the value type of the map. | |
| using | reverse_iterator = ::arene::base::reverse_iterator<iterator> |
The type of an iterator that provides non- const access to the elements and iterates in reverse through the elements. | |
| using | size_type = typename map_base_type::size_type |
| The size type of the map. | |
| using | value_type = typename map_base_type::value_type |
| The value type of the map. | |
Public Member Functions | |
| inline_map ()=default | |
| Construct the map with a default-constructed comparator and no elements. | |
| inline_map (Compare const &compare) noexcept(std::is_nothrow_copy_constructible< Compare >::value) | |
| Construct the map with a copy of the specified comparator and no elements. | |
| inline_map (inline_map const &other)=default | |
| Copy the source map, so the new map has the same size, comparator and elements as the source. | |
| template<std::size_t OtherCapacity, typename SfinaeKey = Key, typename SfinaeValue = Value, typename SfinaeCompare = Compare, constraints< std::enable_if_t< OtherCapacity !=Capacity >, std::enable_if_t< std::is_copy_constructible< SfinaeKey >::value >, std::enable_if_t< std::is_move_constructible< SfinaeValue >::value >, std::enable_if_t< std::is_copy_constructible< SfinaeCompare >::value > > = nullptr> | |
| inline_map (inline_map< Key, Value, OtherCapacity, Compare > &&other) | |
| Move from a map with a different capacity. | |
| template<std::size_t OtherCapacity, typename SfinaeKey = Key, typename SfinaeValue = Value, typename SfinaeCompare = Compare, constraints< std::enable_if_t< OtherCapacity !=Capacity >, std::enable_if_t< std::is_copy_constructible< SfinaeKey >::value >, std::enable_if_t< std::is_copy_constructible< SfinaeValue >::value >, std::enable_if_t< std::is_copy_constructible< SfinaeCompare >::value > > = nullptr> | |
| inline_map (inline_map< Key, Value, OtherCapacity, Compare > const &other) | |
| Copy from a map with a different capacity. | |
| inline_map (move_construct_source &&other) noexcept(std::is_nothrow_move_constructible< Compare >::value &&std::is_nothrow_copy_constructible< Key >::value &&std::is_nothrow_move_constructible< Value >::value) | |
| Move the source map into the new instance, so the new map has the same size, comparator and elements as the source did before-hand. | |
| template<typename T = value_type, typename C = Compare, constraints< std::enable_if_t< std::is_default_constructible< C >::value >, std::enable_if_t< std::is_copy_constructible< T >::value > > = nullptr> | |
| inline_map (std::initializer_list< value_type > init_list) | |
| Construct the map with a default-constructed comparator and copies of the elements from the provided initializer list. | |
| template<typename T = Value, typename C = Compare, constraints< std::enable_if_t< std::is_copy_constructible< T >::value >, std::enable_if_t< std::is_copy_constructible< C >::value > > = nullptr> | |
| inline_map (std::initializer_list< value_type > init_list, Compare const &compare) | |
| Construct the map with a copy of the specified comparator and copies of the elements from the provided initializer list. | |
| ~inline_map ()=default | |
| Default destructor. | |
| template<bool AreExceptionsEnabled = detail::are_exceptions_enabled::value, constraints< std::enable_if_t< AreExceptionsEnabled > > = nullptr> | |
| ARENE_NODISCARD auto | at (Key const &key) -> Value & |
| Obtain a reference to the mapped value for the specified key or throw. | |
| template<bool AreExceptionsEnabled = detail::are_exceptions_enabled::value, constraints< std::enable_if_t< AreExceptionsEnabled > > = nullptr> | |
| ARENE_NODISCARD auto | at (Key const &key) const -> Value const & |
| Obtain a reference to the mapped value for the specified key or throw. | |
| template<typename OtherKey, bool AreExceptionsEnabled = detail::are_exceptions_enabled::value, constraints< std::enable_if_t< AreExceptionsEnabled >, std::enable_if_t< transparent_comparison_supported< OtherKey > > > = nullptr> | |
| ARENE_NODISCARD auto | at (OtherKey const &key) -> Value & |
| Obtain a reference to the mapped value for the specified key or throw. | |
| template<typename OtherKey, bool AreExceptionsEnabled = detail::are_exceptions_enabled::value, constraints< std::enable_if_t< AreExceptionsEnabled >, std::enable_if_t< transparent_comparison_supported< OtherKey > > > = nullptr> | |
| ARENE_NODISCARD auto | at (OtherKey const &key) const -> Value const & |
| Obtain a reference to the mapped value for the specified key or throw. | |
| ARENE_NODISCARD auto | begin () const noexcept -> const_iterator |
| Obtain an iterator referring to the beginning of the sorted range of elements. | |
| ARENE_NODISCARD auto | begin () noexcept -> iterator |
| Obtain an iterator referring to the beginning of the sorted range of elements. | |
| ARENE_NODISCARD auto | cbegin () const noexcept -> const_iterator |
| Obtain an iterator referring to the beginning of the sorted range of elements. | |
| ARENE_NODISCARD auto | cend () const noexcept -> const_iterator |
| Obtain an iterator referring to one past the last element in the sorted range of elements. | |
| void | clear () noexcept |
Destroy all elements in *this and set the size to zero. | |
| auto | contains (Key const &key) const noexcept(comparison_is_noexcept<>) -> bool |
| Check if the set contains a specific key. | |
| template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported< OtherKey > > > = nullptr> | |
| auto | contains (OtherKey const &key) const noexcept(comparison_is_noexcept< OtherKey >) -> bool |
| Check if the set contains a key equivalent to a specific value. | |
| auto | count (Key const &key) const noexcept(comparison_is_noexcept<>) -> size_type |
| Return the number of elements in the map equivalent to a specific key. | |
| template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported< OtherKey > > > = nullptr> | |
| auto | count (OtherKey const &key) const noexcept(comparison_is_noexcept< OtherKey >) -> size_type |
| Return the number of elements in the map equivalent to a specific key. | |
| ARENE_NODISCARD auto | crbegin () const noexcept -> const_reverse_iterator |
| Obtain an iterator referring to the beginning of a reversed traversal of the sorted range of elements. | |
| ARENE_NODISCARD auto | crend () const noexcept -> const_reverse_iterator |
| Obtain an iterator referring to one past the last element in a reversed traversal of the sorted range of elements. | |
| template<typename... Args, constraints< std::enable_if_t< std::is_constructible< value_type, Args &&... >::value > > = nullptr> | |
| auto | emplace (Args &&... args) -> std::pair< iterator, bool > |
Construct a new value_type object and try to insert it in the map if there is not already one with the corresponding key. | |
| ARENE_NODISCARD auto | empty () const noexcept -> bool |
| Check if the map is empty. | |
| ARENE_NODISCARD auto | end () const noexcept -> const_iterator |
| Obtain an iterator referring to one past the last element in the sorted range of elements. | |
| ARENE_NODISCARD auto | end () noexcept -> iterator |
| Obtain an iterator referring to one past the last element in the sorted range of elements. | |
| auto | equal_range (Key const &key) const noexcept(comparison_is_noexcept<>) -> std::pair< const_iterator, const_iterator > |
| Finds the sequence of elements whose keys compare equivalent to a given key. | |
| auto | equal_range (Key const &key) noexcept(comparison_is_noexcept<>) -> std::pair< iterator, iterator > |
| Finds the sequence of elements whose keys compare equivalent to a given key. | |
| template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported< OtherKey > > > = nullptr> | |
| auto | equal_range (OtherKey const &key) const noexcept(comparison_is_noexcept< OtherKey >) -> std::pair< const_iterator, const_iterator > |
| Finds the sequence of elements whose keys compare equivalent to a given key. | |
| template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported< OtherKey > > > = nullptr> | |
| auto | equal_range (OtherKey const &key) noexcept(comparison_is_noexcept< OtherKey >) -> std::pair< iterator, iterator > |
| Finds the sequence of elements whose keys compare equivalent to a given key. | |
| auto | erase (const_iterator first, const_iterator last) noexcept -> iterator |
| Erase all the elements in the specified iterator range. | |
| auto | erase (const_iterator pos) noexcept -> iterator |
| Erase the element at the specified position. | |
| auto | erase (iterator pos) noexcept -> iterator |
| Erase the element at the specified position. | |
| auto | erase (Key const &key) noexcept(comparison_is_noexcept<>) -> iterator |
| Erase the element with the corresponding key, if there is one. | |
| template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported< OtherKey > > > = nullptr> | |
| auto | erase (OtherKey const &key) noexcept(comparison_is_noexcept< OtherKey >) -> iterator |
| Erase the element with the corresponding key, if there is one. | |
| auto | find (Key const &key) const noexcept(comparison_is_noexcept<>) -> const_iterator |
| Obtain an iterator referring to the element equivalent to the supplied key, if there is one. | |
| auto | find (Key const &key) noexcept(comparison_is_noexcept<>) -> iterator |
| Obtain an iterator referring to the element equivalent to the supplied key, if there is one. | |
| template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported< OtherKey > > > = nullptr> | |
| auto | find (OtherKey const &key) const noexcept(comparison_is_noexcept< OtherKey >) -> const_iterator |
| Obtain an iterator referring to the element equivalent to the supplied key, if there is one. | |
| template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported< OtherKey > > > = nullptr> | |
| auto | find (OtherKey const &key) noexcept(comparison_is_noexcept< OtherKey >) -> iterator |
| Obtain an iterator referring to the element equivalent to the supplied key, if there is one. | |
| template<typename P, constraints< std::enable_if_t<!std::is_same< value_type, P >::value >, std::enable_if_t< std::is_constructible< value_type, P && >::value > > = nullptr> | |
| auto | insert (P &&value) -> std::pair< iterator, bool > |
| Insert a new element in the map if there is not already one with the corresponding key. | |
| template<typename SfinaeKey = Key, typename SfinaeValue = Value, constraints< std::enable_if_t< std::is_copy_constructible< SfinaeKey >::value >, std::enable_if_t< std::is_move_constructible< SfinaeValue >::value > > = nullptr> | |
| auto | insert (value_type &&value) -> std::pair< iterator, bool > |
| Insert a new element in the map if there is not already one with the corresponding key. | |
| template<typename SfinaeKey = Key, typename SfinaeValue = Value, constraints< std::enable_if_t< std::is_copy_constructible< SfinaeKey >::value >, std::enable_if_t< std::is_copy_constructible< SfinaeValue >::value > > = nullptr> | |
| auto | insert (value_type const &value) -> std::pair< iterator, bool > |
| Insert a new element in the map if there is not already one with the corresponding key. | |
| template<typename OtherMapped, typename SfinaeKey = Key, constraints< std::enable_if_t< std::is_move_constructible< SfinaeKey >::value >, std::enable_if_t< std::is_constructible< Value, OtherMapped && >::value >, std::enable_if_t< std::is_assignable< Value &, OtherMapped && >::value > > = nullptr> | |
| auto | insert_or_assign (Key &&key, OtherMapped &&mapped_value) -> std::pair< iterator, bool > |
| Insert a new element in the map if there is not already one with the corresponding key, otherwise assigns the new value to the existing one. | |
| template<typename OtherMapped, typename SfinaeKey = Key, constraints< std::enable_if_t< std::is_copy_constructible< SfinaeKey >::value >, std::enable_if_t< std::is_constructible< Value, OtherMapped && >::value >, std::enable_if_t< std::is_assignable< Value &, OtherMapped && >::value > > = nullptr> | |
| auto | insert_or_assign (Key const &key, OtherMapped &&mapped_value) -> std::pair< iterator, bool > |
| Insert a new element in the map if there is not already one with the corresponding key, otherwise assigns the new value to the existing one. | |
| template<typename OtherKey, typename OtherMapped, constraints< std::enable_if_t< transparent_insertion_supported< OtherKey > >, std::enable_if_t< std::is_constructible< Key, OtherKey && >::value >, std::enable_if_t< std::is_constructible< Value, OtherMapped && >::value >, std::enable_if_t< std::is_assignable< Value &, OtherMapped && >::value > > = nullptr> | |
| auto | insert_or_assign (OtherKey &&key, OtherMapped &&mapped_value) -> std::pair< iterator, bool > |
| Insert a new element in the map if there is not already one with an equivalent key, otherwise assigns the new value to the existing one. | |
| ARENE_NODISCARD auto | key_comp () const noexcept(std::is_nothrow_copy_constructible< Compare >::value) -> Compare |
| Obtain a copy of the comparator. | |
| auto | lower_bound (Key const &key) const noexcept(comparison_is_noexcept<>) -> const_iterator |
| Find the first element which is not less than a given key. | |
| auto | lower_bound (Key const &key) noexcept(comparison_is_noexcept<>) -> iterator |
| Find the first element which is not less than a given key. | |
| template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported< OtherKey > > > = nullptr> | |
| auto | lower_bound (OtherKey const &key) const noexcept(comparison_is_noexcept< OtherKey >) -> const_iterator |
| Find the first element which is not less than a given key. | |
| template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported< OtherKey > > > = nullptr> | |
| auto | lower_bound (OtherKey const &key) noexcept(comparison_is_noexcept< OtherKey >) -> iterator |
| Find the first element which is not less than a given key. | |
| auto | operator= (copy_assign_source const &other) noexcept(std::is_nothrow_copy_assignable< Compare >::value &&std::is_nothrow_copy_constructible< Key >::value &&std::is_nothrow_copy_constructible< Value >::value) -> inline_map & |
| copy-assignment of a map with the same capacity. | |
| auto | operator= (dummy_copy_assign_source const &) -> inline_map &=delete |
| Deleted copy-assignment if the map should not be copy-assignable. | |
| auto | operator= (dummy_move_assign_source &&) -> inline_map &=delete |
| Deleted move-assignment if the map should not be move-assignable. | |
| template<std::size_t OtherCapacity, typename SfinaeKey = Key, typename SfinaeValue = Value, typename SfinaeCompare = Compare, constraints< std::enable_if_t<(OtherCapacity > Capacity)>, std::enable_if_t< std::is_copy_constructible< SfinaeKey >::value >, std::enable_if_t< std::is_move_constructible< SfinaeValue >::value >, std::enable_if_t< std::is_move_assignable< SfinaeCompare >::value >> | |
| auto | operator= (inline_map< Key, Value, OtherCapacity, Compare > &&other) -> inline_map & |
| Move-assignment of a map with a greater capacity. | |
| template<std::size_t OtherCapacity, typename SfinaeKey = Key, typename SfinaeValue = Value, typename SfinaeCompare = Compare, constraints< std::enable_if_t<(OtherCapacity< Capacity)>, std::enable_if_t< std::is_copy_constructible< SfinaeKey >::value >, std::enable_if_t< std::is_move_constructible< SfinaeValue >::value >, std::enable_if_t< std::is_move_assignable< SfinaeCompare >::value > > = nullptr> | |
| auto | operator= (inline_map< Key, Value, OtherCapacity, Compare > &&other) -> inline_map & |
| Move-assignment of a map with a lesser capacity. | |
| template<std::size_t OtherCapacity, typename SfinaeKey = Key, typename SfinaeValue = Value, typename SfinaeCompare = Compare, constraints< std::enable_if_t<(OtherCapacity > Capacity)>, std::enable_if_t< std::is_copy_constructible< SfinaeKey >::value >, std::enable_if_t< std::is_copy_constructible< SfinaeValue >::value >, std::enable_if_t< std::is_move_assignable< SfinaeCompare >::value >> | |
| auto | operator= (inline_map< Key, Value, OtherCapacity, Compare > const &other) -> inline_map & |
| copy-assignment of a map with a greater capacity. | |
| template<std::size_t OtherCapacity, typename SfinaeKey = Key, typename SfinaeValue = Value, typename SfinaeCompare = Compare, constraints< std::enable_if_t<(OtherCapacity< Capacity)>, std::enable_if_t< std::is_copy_constructible< SfinaeKey >::value >, std::enable_if_t< std::is_copy_constructible< SfinaeValue >::value >, std::enable_if_t< std::is_move_assignable< SfinaeCompare >::value > > = nullptr> | |
| auto | operator= (inline_map< Key, Value, OtherCapacity, Compare > const &other) -> inline_map & |
| copy-assignment of a map with a smaller capacity. | |
| auto | operator= (move_assign_source &&other) noexcept(std::is_nothrow_move_assignable< Compare >::value &&std::is_nothrow_move_constructible< value_type >::value) -> inline_map & |
| Move-assignment of a map with the same capacity. | |
| auto | operator[] (Key const &key) -> Value & |
| Obtain a reference to the mapped value for the specified key. | |
| template<typename OtherKey, constraints< std::enable_if_t< transparent_insertion_supported< OtherKey > >, std::enable_if_t< std::is_constructible< Key, OtherKey const & >::value > > = nullptr> | |
| auto | operator[] (OtherKey const &key) -> Value & |
| Obtain a reference to the mapped value for the specified key. | |
| ARENE_NODISCARD auto | rbegin () const noexcept -> const_reverse_iterator |
| Obtain an iterator referring to the beginning of a reversed traversal of the sorted range of elements. | |
| ARENE_NODISCARD auto | rbegin () noexcept -> reverse_iterator |
| Obtain an iterator referring to the beginning of a reversed traversal of the sorted range of elements. | |
| ARENE_NODISCARD auto | rend () const noexcept -> const_reverse_iterator |
| Obtain an iterator referring to one past the last element in a reversed traversal of the sorted range of elements. | |
| ARENE_NODISCARD auto | rend () noexcept -> reverse_iterator |
| Obtain an iterator referring to one past the last element in a reversed traversal of the sorted range of elements. | |
| ARENE_NODISCARD auto | size () const noexcept -> size_type |
| Get the number of elements in the map. | |
| template<typename... Args, typename SfinaeKey = Key, constraints< std::enable_if_t< std::is_move_constructible< SfinaeKey >::value >, std::enable_if_t< std::is_constructible< Value, Args &&... >::value > > = nullptr> | |
| auto | try_emplace (Key &&key, Args &&... args) -> std::pair< iterator, bool > |
| Try to emplace a new element in the map if there is not already one with the corresponding key. | |
| template<typename... Args, typename SfinaeKey = Key, constraints< std::enable_if_t< std::is_copy_constructible< SfinaeKey >::value >, std::enable_if_t< std::is_constructible< Value, Args &&... >::value > > = nullptr> | |
| auto | try_emplace (Key const &key, Args &&... args) -> std::pair< iterator, bool > |
| Try to emplace a new element in the map if there is not already one with the corresponding key. | |
| template<typename OtherKey, typename... Args, constraints< std::enable_if_t< transparent_insertion_supported< OtherKey > >, std::enable_if_t<!decays_to_v< OtherKey, Key > >, std::enable_if_t< std::is_constructible< Key, OtherKey && >::value >, std::enable_if_t< std::is_constructible< Value, Args &&... >::value > > = nullptr> | |
| auto | try_emplace (OtherKey &&key, Args &&... args) -> std::pair< iterator, bool > |
| Try to emplace a new element in the map if there is not already one with an equivalent key. | |
| auto | upper_bound (Key const &key) const noexcept(comparison_is_noexcept<>) -> const_iterator |
| Find the first element which is greater than a given key. | |
| auto | upper_bound (Key const &key) noexcept(comparison_is_noexcept<>) -> iterator |
| Find the first element which is greater than a given key. | |
| template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported< OtherKey > > > = nullptr> | |
| auto | upper_bound (OtherKey const &key) const noexcept(comparison_is_noexcept< OtherKey >) -> const_iterator |
| Find the first element which is greater than a given key. | |
| template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported< OtherKey > > > = nullptr> | |
| auto | upper_bound (OtherKey const &key) noexcept(comparison_is_noexcept< OtherKey >) -> iterator |
| Find the first element which is greater than a given key. | |
Static Public Member Functions | |
| template<size_type OtherCapacity> | |
| static ARENE_NODISCARD auto | fast_inequality_check (inline_map const &lhs, inline_map< Key, Value, OtherCapacity, Compare > const &rhs) noexcept -> inequality_heuristic |
| Fast inequality heuristic to shortcut on different sized containers. | |
| template<size_type OtherCapacity, typename SfinaeKey = key_type, typename SfinaeMappedType = mapped_type, constraints< std::enable_if_t< compare_three_way_supported_v< SfinaeKey > >, std::enable_if_t< compare_three_way_supported_v< SfinaeMappedType > > > = nullptr> | |
| static ARENE_NODISCARD auto | three_way_compare (inline_map const &lhs, inline_map< Key, Value, OtherCapacity, Compare > const &rhs) noexcept -> strong_ordering |
| Compares two maps lexicographically . | |
| template<typename C = Compare, constraints< std::enable_if_t< std::is_default_constructible< C >::value > > = nullptr> | |
| static ARENE_NODISCARD auto | try_construct () noexcept(std::is_nothrow_default_constructible< Compare >::value) -> optional< inline_map > |
| Construct an empty map with a default-constructed comparator. | |
| template<typename C = Compare, constraints< std::enable_if_t< std::is_copy_constructible< C >::value > > = nullptr> | |
| static ARENE_NODISCARD auto | try_construct (Compare const &comparator) noexcept(std::is_nothrow_copy_constructible< Compare >::value) -> optional< inline_map > |
| Construct a map with a comparator copied from the supplied value. | |
| template<typename K = Key, typename V = Value, typename C = Compare, constraints< std::enable_if_t< std::is_move_constructible< C >::value >, std::enable_if_t< std::is_copy_constructible< K >::value >, std::enable_if_t< std::is_move_constructible< V >::value > > = nullptr> | |
| static ARENE_NODISCARD auto | try_construct (inline_map &&other) noexcept(std::is_nothrow_move_constructible< C >::value &&std::is_nothrow_copy_constructible< K >::value &&std::is_nothrow_move_constructible< V >::value) -> optional< inline_map > |
| Move construct a map. | |
| template<typename V = value_type, typename C = Compare, constraints< std::enable_if_t< std::is_copy_constructible< C >::value >, std::enable_if_t< std::is_copy_constructible< V >::value > > = nullptr> | |
| static ARENE_NODISCARD auto | try_construct (inline_map const &other) noexcept(std::is_nothrow_copy_constructible< C >::value &&std::is_nothrow_copy_constructible< V >::value) -> optional< inline_map > |
| Copy construct a map. | |
| template<std::size_t OtherCapacity, typename K = Key, typename V = Value, typename C = Compare, constraints< std::enable_if_t< OtherCapacity !=Capacity >, std::enable_if_t< std::is_copy_constructible< K >::value >, std::enable_if_t< std::is_move_constructible< V >::value >, std::enable_if_t< std::is_copy_constructible< C >::value > > = nullptr> | |
| static ARENE_NODISCARD auto | try_construct (inline_map< Key, Value, OtherCapacity, Compare > &&other) noexcept(std::is_nothrow_copy_constructible< C >::value &&std::is_nothrow_copy_constructible< K >::value &&std::is_nothrow_move_constructible< V >::value) -> optional< inline_map > |
| Move construct a map with a different size. | |
| template<std::size_t OtherCapacity, typename V = value_type, typename C = Compare, constraints< std::enable_if_t< OtherCapacity !=Capacity >, std::enable_if_t< std::is_copy_constructible< V >::value >, std::enable_if_t< std::is_copy_constructible< C >::value > > = nullptr> | |
| static ARENE_NODISCARD auto | try_construct (inline_map< Key, Value, OtherCapacity, Compare > const &other) noexcept(std::is_nothrow_copy_constructible< C >::value &&std::is_nothrow_copy_constructible< V >::value) -> optional< inline_map > |
| Copy construct a map with a different size. | |
| template<typename T = value_type, typename C = Compare, constraints< std::enable_if_t< std::is_default_constructible< C >::value >, std::enable_if_t< std::is_copy_constructible< T >::value > > = nullptr> | |
| static ARENE_NODISCARD auto | try_construct (std::initializer_list< value_type > init_list) noexcept(std::is_nothrow_default_constructible< Compare >::value &&comparison_is_noexcept<> &&std::is_nothrow_copy_constructible< Key >::value &&std::is_nothrow_copy_constructible< Value >::value) -> optional< inline_map > |
Construct a map with a default-constructed comparator and copies of the elements from the provided initializer list. If there are too many elements, return an empty optional. | |
| template<typename T = value_type, typename C = Compare, constraints< std::enable_if_t< std::is_copy_constructible< C >::value >, std::enable_if_t< std::is_copy_constructible< T >::value > > = nullptr> | |
| static ARENE_NODISCARD auto | try_construct (std::initializer_list< value_type > init_list, Compare const &comparator) noexcept(std::is_nothrow_copy_constructible< Compare >::value &&comparison_is_noexcept<> &&std::is_nothrow_copy_constructible< Key >::value &&std::is_nothrow_copy_constructible< Value >::value) -> optional< inline_map > |
Construct a map with a comparator copied from the supplied value and copies of the elements from the provided initializer list. If there are too many elements, return an empty optional. | |
Static Public Attributes | |
| static constexpr std::integral_constant< size_type, Capacity > | capacity {} |
| map capacity | |
| static constexpr std::integral_constant< size_type, Capacity > | max_size {} |
Get the maximum number of elements in the map, Capacity. | |
Friends | |
| template<typename OtherKey, typename OtherValue, std::size_t OtherCapacity, typename OtherCompare> | |
| class | inline_map |
| template<size_type OtherCapacity, typename SfinaeValue = value_type, constraints< std::enable_if_t< is_equality_comparable_v< SfinaeValue > > > = nullptr> | |
| ARENE_NODISCARD friend auto | operator!= (inline_map const &lhs, inline_map< Key, Value, OtherCapacity, Compare > const &rhs) noexcept -> bool |
Compares two maps for inequality of elements when mapped_value is not three-way-comparable. | |
| template<size_type OtherCapacity, typename SfinaeValue = value_type, constraints< std::enable_if_t< is_equality_comparable_v< SfinaeValue > > > = nullptr> | |
| ARENE_NODISCARD friend auto | operator== (inline_map const &lhs, inline_map< Key, Value, OtherCapacity, Compare > const &rhs) noexcept -> bool |
Compares two maps for equality of elements when mapped_value is not three-way-comparable. | |
| template<typename Self, constraints< std::enable_if_t< decays_to_v< Self, inline_map > > > = nullptr> | |
| auto | value_at_index (inline_map_passkey, Self &self, std::uint16_t index) -> conditional_t< std::is_const< std::remove_reference_t< Self > >::value, value_type const &, value_type & > |
| Gets the value at an index. | |
A container similar to std::map that has a fixed capacity.
The storage is held internally in the object. Any attempt to store more than Capacity elements will either result in a precondition failure (and thus process termination), or an error being returned. The comparison function specified with the Compare template parameter can either return bool, in which case it is assumed to be a simple ordering comparison like std::less, or it can return strong_ordering, in which case it is assumed to be a three-way comparison operator. The default comparison is three_way_compare.
| Key | The key type for the map |
| Value | The mapped type for the map |
| Capacity | The maximum number of elements that can be stored in the map |
| Compare | The comparison function |
Key | using arene::base::inline_map< Key, Value, Capacity, Compare >::const_iterator = iterator_impl<true> |
The type of an iterator that provides const access to the elements.
| using arene::base::inline_map< Key, Value, Capacity, Compare >::const_pointer = value_type const* |
The type of a const pointer to the value type of the map.
| using arene::base::inline_map< Key, Value, Capacity, Compare >::const_reference = value_type const& |
The type of a const reference to the value type of the map.
| using arene::base::inline_map< Key, Value, Capacity, Compare >::const_reverse_iterator = ::arene::base::reverse_iterator<const_iterator> |
The type of an iterator that provides const access to the elements and iterates in reverse through the elements.
| using arene::base::inline_map< Key, Value, Capacity, Compare >::difference_type = typename iterator::difference_type |
The difference type of the map.
| using arene::base::inline_map< Key, Value, Capacity, Compare >::inline_map_base_type = map_base_type |
inline_map_base type
| using arene::base::inline_map< Key, Value, Capacity, Compare >::iterator = iterator_impl<false> |
The type of an iterator that provides non- const access to the elements.
| using arene::base::inline_map< Key, Value, Capacity, Compare >::key_compare = typename map_base_type::compare_type |
The comparator of the map.
| using arene::base::inline_map< Key, Value, Capacity, Compare >::key_type = typename map_base_type::key_type |
The key type of the map.
| using arene::base::inline_map< Key, Value, Capacity, Compare >::mapped_type = typename map_base_type::mapped_type |
The mapped type of the map.
| using arene::base::inline_map< Key, Value, Capacity, Compare >::pointer = value_type* |
The type of a pointer to the value type of the map.
| using arene::base::inline_map< Key, Value, Capacity, Compare >::reference = value_type& |
The type of a reference to the value type of the map.
| using arene::base::inline_map< Key, Value, Capacity, Compare >::reverse_iterator = ::arene::base::reverse_iterator<iterator> |
The type of an iterator that provides non- const access to the elements and iterates in reverse through the elements.
| using arene::base::inline_map< Key, Value, Capacity, Compare >::size_type = typename map_base_type::size_type |
The size type of the map.
| using arene::base::inline_map< Key, Value, Capacity, Compare >::value_type = typename map_base_type::value_type |
The value type of the map.
|
default |
Construct the map with a default-constructed comparator and no elements.
| Any | exception thrown by the default constructor of the comparator |
|
default |
Default destructor.
|
inline |
Construct the map with a default-constructed comparator and copies of the elements from the provided initializer list.
| T | The value type of the map, used so this constructor is not viable if value_type cannot be copy constructed. |
| C | The comparator type of the map, used so this constructor is not viable if Compare cannot be default constructed. |
| init_list | The initializer list |
| Any | exception thrown by the default constructor of the comparator, the copy constructor of the keys or values, or the comparisons |
Capacity elements in init_list with unique keys, else ARENE_PRECONDITION violation.
|
inline |
Construct the map with a copy of the specified comparator and copies of the elements from the provided initializer list.
| T | The value type of the map, used so this constructor is not viable if value_type cannot be copy constructed. |
| C | The comparator type of the map, used so this constructor is not viable if Compare cannot be copy constructed. |
| init_list | The initializer list |
| compare | The comparator to copy |
| Any | exception thrown by the copy-constructor of the comparator, the copy constructor of the keys or values, or the comparisons |
Capacity elements in init_list with unique keys, else ARENE_PRECONDITION violation.
|
inlineexplicitnoexcept |
Construct the map with a copy of the specified comparator and no elements.
| compare | The comparator to copy# |
| Any | exception thrown by the copy-constructor of the comparator |
|
default |
Copy the source map, so the new map has the same size, comparator and elements as the source.
| other | The instance to be copied. |
| Any | exception thrown by the copy constructor of the comparator, the keys, or values |
|
inlinenoexcept |
Move the source map into the new instance, so the new map has the same size, comparator and elements as the source did before-hand.
All the keys from the source map are copy-constructed, and all the mapped values are move-constructed.
| other | The instance to be copied. |
| Any | exception thrown by the copy constructor of the comparator or the keys, or the move-constructor of the values |
|
inline |
Copy from a map with a different capacity.
| OtherCapacity | The capacity of the other map |
| SfinaeKey | Dummy key type for SFINAE |
| SfinaeValue | Dummy value type for SFINAE |
| SfinaeCompare | Dummy compare type for SFINAE |
| other | The source map |
| Any | exception thrown by the copy constructors of the comparator, keys or values |
other.size()<=Capacity, else ARENE_PRECONDITION violation.
|
inline |
Move from a map with a different capacity.
| OtherCapacity | The capacity of the other map |
| SfinaeKey | Dummy key type for SFINAE |
| SfinaeValue | Dummy value type for SFINAE |
| SfinaeCompare | Dummy compare type for SFINAE |
| other | The source map |
| Any | exception thrown by the copy constructors of the comparator or keys or the move constructor of the values |
other.size()<=Capacity, else ARENE_PRECONDITION violation.
|
inline |
Obtain a reference to the mapped value for the specified key or throw.
| key | The key to obtain the value for |
| std::out_of_range | if find(key)==end() . |
| Any | exception thrown by the comparisons |
|
inline |
Obtain a reference to the mapped value for the specified key or throw.
| key | The key to obtain the value for |
| std::out_of_range | if find(key)==end() . |
| Any | exception thrown by the comparisons |
|
inline |
Obtain a reference to the mapped value for the specified key or throw.
| OtherKey | the type of the key to find. Must satisfy is_transparent_comparator_for<Compare,Key,K> or is_transparent_three_way_comparator_for<Compare,Key,K> . |
| key | The key to obtain the value for |
| std::out_of_range | if find(key)==end() . |
| Any | exception thrown by the comparisons |
|
inline |
Obtain a reference to the mapped value for the specified key or throw.
| OtherKey | the type of the key to find. Must satisfy is_transparent_comparator_for<Compare,Key,K> or is_transparent_three_way_comparator_for<Compare,Key,K> . |
| key | The key to obtain the value for |
| std::out_of_range | if find(key)==end() . |
| Any | exception thrown by the comparisons |
|
inlinenoexcept |
Obtain an iterator referring to the beginning of the sorted range of elements.
end() if empty() .
|
inlinenoexcept |
|
inlinenoexcept |
Obtain an iterator referring to the beginning of the sorted range of elements.
end() if empty() .
|
inlinenoexcept |
Obtain an iterator referring to one past the last element in the sorted range of elements.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Check if the set contains a key equivalent to a specific value.
| OtherKey | the type of the key to find. Must satisfy is_transparent_comparator_for<Compare,Key,K> or is_transparent_three_way_comparator_for<Compare,Key,K> . |
| key | The key to search for |
|
inlinenoexcept |
Return the number of elements in the map equivalent to a specific key.
| key | The key to search for. |
0 if the element was not in the map, else 1 .
|
inlinenoexcept |
Return the number of elements in the map equivalent to a specific key.
| OtherKey | the type of the key to find. Must satisfy is_transparent_comparator_for<Compare,Key,K> or is_transparent_three_way_comparator_for<Compare,Key,K> . |
| key | The key to search for. |
0 if the element was not in the map, else 1 .
|
inlinenoexcept |
Obtain an iterator referring to the beginning of a reversed traversal of the sorted range of elements.
rend() if empty() .
|
inlinenoexcept |
Obtain an iterator referring to one past the last element in a reversed traversal of the sorted range of elements.
|
inline |
Construct a new value_type object and try to insert it in the map if there is not already one with the corresponding key.
Perfectly forwards the provided arguments into the constructor of the new element if an appropriate element does not already exist.
| Args | The types of the initializers for the value type |
| args | The values with which to construct the value value |
key, and a boolean with a value of true if the element was inserted, or false otherwise. | Any | exception thrown by the comparisons, the constructor of value_type |
size()<Capacity or there is already a corresponding element in the map, else ARENE_PRECONDITION violation.
|
inlinenoexcept |
Check if the map is empty.
true if the map is empty, false otherwise
|
inlinenoexcept |
Obtain an iterator referring to one past the last element in the sorted range of elements.
|
inlinenoexcept |
Obtain an iterator referring to one past the last element in the sorted range of elements.
|
inlinenoexcept |
Finds the sequence of elements whose keys compare equivalent to a given key.
| key | The key to search for |
[first,second) have keys which compare equal to key if there was a key equivalent to key in the map. Otherwise both iterators will be end() .
|
inlinenoexcept |
Finds the sequence of elements whose keys compare equivalent to a given key.
| key | The key to search for |
[first,second) have keys which compare equal to key if there was a key equivalent to key in the map. Otherwise both iterators will be end() .
|
inlinenoexcept |
Finds the sequence of elements whose keys compare equivalent to a given key.
| OtherKey | the type of the key to find. Must satisfy is_transparent_comparator_for<Compare,Key,K> or is_transparent_three_way_comparator_for<Compare,Key,K> . |
| key | The key to search for |
[first,second) have keys which compare equal to key if there was a key equivalent to key in the map. Otherwise both iterators will be end() .
|
inlinenoexcept |
Finds the sequence of elements whose keys compare equivalent to a given key.
| OtherKey | the type of the key to find. Must satisfy is_transparent_comparator_for<Compare,Key,K> or is_transparent_three_way_comparator_for<Compare,Key,K> . |
| key | The key to search for |
[first,second) have keys which compare equal to key if there was a key equivalent to key in the map. Otherwise both iterators will be end() .
|
inlinenoexcept |
Erase all the elements in the specified iterator range.
| first | An iterator referring to the start of the range to erase |
| last | An iterator referring to the end of the range to erase |
end() if there is no such element. [first,last) must be a valid iterator range referring to *this, else ARENE_PRECONDITION violation.
|
inlinenoexcept |
Erase the element at the specified position.
| pos | An iterator referring to the element to erase |
end() if there is no such element. pos must be a valid dereferencable iterator referring to an element in *this, else ARENE_PRECONDITION violation.
|
inlinenoexcept |
Erase the element at the specified position.
| pos | An iterator referring to the element to erase |
end() if there is no such element. pos must be a valid dereferencable iterator referring to an element in *this, else ARENE_PRECONDITION violation.
|
inlinenoexcept |
Erase the element with the corresponding key, if there is one.
| key | The key to erase. |
|
inlinenoexcept |
Erase the element with the corresponding key, if there is one.
| OtherKey | the type of the key to find. Must satisfy is_transparent_comparator_for<Compare,Key,K> or is_transparent_three_way_comparator_for<Compare,Key,K> . |
| key | The key to erase. |
|
inlinestaticnoexcept |
Fast inequality heuristic to shortcut on different sized containers.
| OtherCapacity | the capacity of rhs |
| lhs | The left-hand operand to the check |
| rhs | The right-hand operand to the check |
lhs.size()==rhs.size() lhs.size()!=rhs.size()
|
inlinenoexcept |
Obtain an iterator referring to the element equivalent to the supplied key, if there is one.
| key | The key to find |
end() if the element is not found
|
inlinenoexcept |
Obtain an iterator referring to the element equivalent to the supplied key, if there is one.
| key | The key to find |
end() if the element is not found
|
inlinenoexcept |
Obtain an iterator referring to the element equivalent to the supplied key, if there is one.
| OtherKey | the type of the key to find. Must satisfy is_transparent_comparator_for<Compare,Key,K> or is_transparent_three_way_comparator_for<Compare,Key,K> . |
| key | The key to find |
end() if the element is not found
|
inlinenoexcept |
Obtain an iterator referring to the element equivalent to the supplied key, if there is one.
| OtherKey | the type of the key to find. Must satisfy is_transparent_comparator_for<Compare,Key,K> or is_transparent_three_way_comparator_for<Compare,Key,K> . |
| key | The key to find |
end() if the element is not found
|
inline |
Insert a new element in the map if there is not already one with the corresponding key.
If an element does not already exist with the given key, the key is copy-constructed into the map while the value is move-constructed.
| P | The type of the provided initializer |
| value | The value to insert |
v.first, and whose second element is a boolean with a value of true if the element was inserted, or false otherwise. contains(value.first) is true, or size()<Capacity, else ARENE_PRECONDITION violation. | Any | exception thrown by the comparisons, or the copy constructor of value_type |
|
inline |
Insert a new element in the map if there is not already one with the corresponding key.
If an element does not already exist with the given key, the key is copy-constructed into the map while the value is move-constructed.
| SfinaeKey | Dummy key type for SFINAE. |
| SfinaeValue | Dummy value type for SFINAE. |
| value | The value to insert |
v.first, and whose second element is a boolean with a value of true if the element was inserted, or false otherwise. contains(value.first) is true, or size()<Capacity, else ARENE_PRECONDITION violation. | Any | exception thrown by the comparisons, or the copy constructor of value_type |
|
inline |
Insert a new element in the map if there is not already one with the corresponding key.
Copy constructs the provided value into the new element if an appropriate element does not already exist.
| SfinaeKey | Dummy key type for SFINAE. |
| SfinaeValue | Dummy value type for SFINAE. |
| value | The value to insert |
v.first, and whose second element is a boolean with a value of true if the element was inserted, or false otherwise. contains(value.first) is true, or size()<Capacity, else ARENE_PRECONDITION violation. | Any | exception thrown by the comparisons, or the copy constructor of value_type |
|
inline |
Insert a new element in the map if there is not already one with the corresponding key, otherwise assigns the new value to the existing one.
Perfectly forwards the provided key and value into the constructor of the new element if an appropriate element does not already exist; perfectly forwards into the assignment operator for the existing element if there is one.
| OtherMapped | The type of the initializer for the mapped type |
| SfinaeKey | The key type, used to delete this overload if the key is not move constructible |
| key | The key for which to insert or assign an element |
| mapped_value | The value with which to construct or assign the mapped value |
key, and a boolean with a value of true if the element was inserted, or false otherwise. contains(key) is true, or size()<Capacity, else ARENE_PRECONDITION violation. | Any | exception thrown by the comparisons, the move constructor of Key or the constructor or assignment operator of Value . |
|
inline |
Insert a new element in the map if there is not already one with the corresponding key, otherwise assigns the new value to the existing one.
Perfectly forwards the provided key and value into the constructor of the new element if an appropriate element does not already exist; perfectly forwards into the assignment operator for the existing element if there is one.
| OtherMapped | The type of the initializer for the mapped type |
| SfinaeKey | The key type, used to delete this overload if the key is not copy constructible |
| key | The key for which to insert or assign an element |
| mapped_value | The value with which to construct or assign the mapped value |
key, and a boolean with a value of true if the element was inserted, or false otherwise. contains(key) is true, or size()<Capacity, else ARENE_PRECONDITION violation. | Any | exception thrown by the comparisons, the move constructor of Key or the constructor or assignment operator of Value . |
|
inline |
Insert a new element in the map if there is not already one with an equivalent key, otherwise assigns the new value to the existing one.
Perfectly forwards the provided key and value into the constructor of the new element if an appropriate element does not already exist; perfectly forwards into the assignment operator for the existing element if there is one.
| OtherKey | The key type. Must satisfy decays_to_v<K, Key> || transparent_comparison_supported<K> and std::is_constructible<Key, K&&> |
| OtherMapped | The type of the initializer for the mapped type |
| key | The key for which to insert or assign an element |
| mapped_value | The value with which to construct or assign the mapped value |
key, and a boolean with a value of true if the element was inserted, or false otherwise. contains(key) is true, or size()<Capacity, else ARENE_PRECONDITION violation. | Any | exception thrown by the comparisons, the move constructor of Key or the constructor or assignment operator of Value . |
|
inlinenoexcept |
Obtain a copy of the comparator.
| Any | exception thrown by the copy-constructor of the comparator |
|
inlinenoexcept |
Find the first element which is not less than a given key.
| key | The key to find the lower bound for. |
key , or end() if there is no such element.
|
inlinenoexcept |
Find the first element which is not less than a given key.
| key | The key to find the lower bound for. |
key , or end() if there is no such element.
|
inlinenoexcept |
Find the first element which is not less than a given key.
| OtherKey | the type of the key to find. Must satisfy is_transparent_comparator_for<Compare,Key,K> or is_transparent_three_way_comparator_for<Compare,Key,K> . |
| key | The key to find the lower bound for. |
key , or end() if there is no such element.
|
inlinenoexcept |
Find the first element which is not less than a given key.
| OtherKey | the type of the key to find. Must satisfy is_transparent_comparator_for<Compare,Key,K> or is_transparent_three_way_comparator_for<Compare,Key,K> . |
| key | The key to find the lower bound for. |
key , or end() if there is no such element.
|
inlinenoexcept |
copy-assignment of a map with the same capacity.
If an exception is thrown then *this is left in a valid state containing the subset of elements copied from the source prior to the exception being thrown.
| other | The instance to be copied. |
*this | Any | exception thrown by the copy assignment of the comparator, or the copy constructors of the keys, or values |
|
delete |
Deleted copy-assignment if the map should not be copy-assignable.
|
delete |
Deleted move-assignment if the map should not be move-assignable.
|
inline |
Move-assignment of a map with a greater capacity.
All the keys from the source map are copy-constructed, and all the mapped values are move-constructed. The source map is cleared, so all elements are destroyed and this size is zero. If an exception is thrown then *this is left in a valid state containing the subset of elements moved from the source prior to the exception being thrown, and the source is left empty.
| OtherCapacity | The capacity of the other map |
| SfinaeKey | Dummy key type for SFINAE |
| SfinaeValue | Dummy value type for SFINAE |
| SfinaeCompare | Dummy comparator type for SFINAE |
| other | The instance to be moved. |
*this other.size()<=Capacity, else ARENE_PRECONDITION violation. | Any | exception thrown by the move-assignment of the comparator or the copy-constructor of the keys, or the move-constructor of the values |
|
inline |
Move-assignment of a map with a lesser capacity.
All the keys from the source map are copy-constructed, and all the mapped values are move-constructed. The source map is cleared, so all elements are destroyed and this size is zero. If an exception is thrown then *this is left in a valid state containing the subset of elements moved from the source prior to the exception being thrown, and the source is left empty.
| OtherCapacity | The capacity of the other map |
| SfinaeKey | Dummy key type for SFINAE |
| SfinaeValue | Dummy value type for SFINAE |
| SfinaeCompare | Dummy comparator type for SFINAE |
| other | The instance to be moved. |
*this | Any | exception thrown by the move-assignment of the comparator or the copy-constructor of the keys, or the move-constructor of the values |
|
inline |
copy-assignment of a map with a greater capacity.
If an exception is thrown then *this is left in a valid state containing the subset of elements copied from the source prior to the exception being thrown.
| OtherCapacity | The capacity of the other map |
| SfinaeCompare | Dummy key type for SFINAE |
| SfinaeValue | Dummy value type for SFINAE |
| SfinaeCompare | Dummy compare type for SFINAE |
| other | The instance to be copied. |
*this | Any | exception thrown by the copy assignment of the comparator, or the copy constructors of the keys, or values. |
other.size()<=Capacity, else ARENE_PRECONDITION violation.
|
inline |
copy-assignment of a map with a smaller capacity.
If an exception is thrown then *this is left in a valid state containing the subset of elements copied from the source prior to the exception being thrown.
| OtherCapacity | The capacity of the other map |
| SfinaeKey | Dummy key type for SFINAE |
| SfinaeValue | Dummy value type for SFINAE |
| SfinaeCompare | Dummy comparator type for SFINAE |
| other | The instance to be copied. |
*this | Any | exception thrown by the copy assignment of the comparator, or the copy constructors of the keys, or values |
|
inlinenoexcept |
Move-assignment of a map with the same capacity.
All the keys from the source map are copy-constructed, and all the mapped values are move-constructed. The source map is cleared, so all elements are destroyed and this size is zero. If an exception is thrown then *this is left in a valid state containing the subset of elements moved from the source prior to the exception being thrown, and the source is left empty.
| other | The instance to be moved. |
*this | Any | exception thrown by the move-assignment of the comparator or the copy-constructor of the keys, or the move-constructor of the values |
|
inline |
Obtain a reference to the mapped value for the specified key.
| key | The key to obtain the value for |
key did not exist in the map, then a default constructed Value is inserted into the map at key and a reference to it is returned. | Any | exception thrown by the comparisons, and exception throw by the copy-constructor of Key, or the default-constructor of Value |
size()<Capacity if key is not in *this
|
inline |
Obtain a reference to the mapped value for the specified key.
| OtherKey | the type of the key to find. Must satisfy is_transparent_comparator_for<Compare,Key,K> or is_transparent_three_way_comparator_for<Compare,Key,K> , and std::is_constructible<Key,const K&> . |
| key | The key to obtain the value for |
key did not exist in the map, then a default constructed Value is inserted into the map at key and a reference to it is returned. | Any | exception thrown by the comparisons, and exception throw by the copy-constructor of Key, or the default-constructor of Value, or |
size()<Capacity if key is not in *this
|
inlinenoexcept |
Obtain an iterator referring to the beginning of a reversed traversal of the sorted range of elements.
rend() if empty() .
|
inlinenoexcept |
Obtain an iterator referring to the beginning of a reversed traversal of the sorted range of elements.
rend() if empty() .
|
inlinenoexcept |
Obtain an iterator referring to one past the last element in a reversed traversal of the sorted range of elements.
|
inlinenoexcept |
Obtain an iterator referring to one past the last element in a reversed traversal of the sorted range of elements.
|
inlinenoexcept |
Get the number of elements in the map.
|
inlinestaticnoexcept |
Compares two maps lexicographically .
Compare . That is, it is a lexicographic comparison between the value_type elements of each container, in iteration order, using the standard compare_three_way facility. This means that for all possible maps which result in element sequences {{1,"a"}, {2, "b"}, {3,"c"}} and {{1,"a"}, {2, "b"}, {5,"d"}}, when compared against each other the result of the comparison will always be the same, strong_ordering::less.| OtherCapacity | the capacity of rhs |
| SfinaeKey | dummy template parameter to disable the operator if key_Type is not three way comparable. |
| SfinaeMappedType | dummy template parameter to disable the operator if mapped_type is not three way comparable. |
| lhs | The left hand operand to the comparison. |
| rhs | The right hand operand to the comparison. |
arene::base::lexicographical_compare_three_way(lhs.begin(),lhs.end(),rhs.begin(),rhs.end())
|
inlinestaticnoexcept |
Construct an empty map with a default-constructed comparator.
| C | The comparator type of the map, used for constraints |
| Any | exception thrown by the default constructor of the comparator, |
|
inlinestaticnoexcept |
Construct a map with a comparator copied from the supplied value.
| C | The comparator type of the map, used so this function is not viable if Compare cannot be copy constructed. |
| comparator | A comparator instance to copy |
| Any | exception thrown by the copy constructor of the comparator |
|
inlinestaticnoexcept |
Move construct a map.
| K | The key type |
| V | The value type |
| C | The comparator type of the map, used for constraints |
| other | The source container |
| Any | exception thrown by the move constructor of the comparator, or the values |
|
inlinestaticnoexcept |
Copy construct a map.
| V | The value type of the map, used for constraints |
| C | The comparator type of the map, used for constraints |
| other | The source container |
| Any | exception thrown by the copy constructor of the comparator, or the values |
|
inlinestaticnoexcept |
Move construct a map with a different size.
| OtherCapacity | The capacity of the other map |
| K | The key type |
| V | The value type |
| C | The comparator type |
| other | The source map |
| Any | exception thrown by the copy constructor of the comparator, or the move constructor of the keys or values |
nullopt if there were too many elements
|
inlinestaticnoexcept |
Copy construct a map with a different size.
| OtherCapacity | The capacity of the other map |
| V | The value_type |
| C | The comparator type |
| other | The source map |
| Any | exception thrown by the copy constructors of the comparator, keys or values |
nullopt if there were too many elements
|
inlinestaticnoexcept |
Construct a map with a default-constructed comparator and copies of the elements from the provided initializer list. If there are too many elements, return an empty optional.
| T | The value type of the map, used so this function is not viable if value_type cannot be copy constructed. |
| C | The comparator type of the map, used so this function is not viable if Compare cannot be default constructed. |
| init_list | The initializer list |
| Any | exception thrown by the default constructor of the comparator, the copy constructor of the keys or values, or the comparisons |
nullopt if there were too many elements.
|
inlinestaticnoexcept |
Construct a map with a comparator copied from the supplied value and copies of the elements from the provided initializer list. If there are too many elements, return an empty optional.
| T | The value type of the map, used so this function is not viable if value_type cannot be copy constructed. |
| C | The comparator type of the map, used so this function is not viable if Compare cannot be default constructed. |
| init_list | The initializer list |
| comparator | A comparator instance to copy |
| Any | exception thrown by the copy constructor of the comparator, the copy constructor of the keys or values, or the comparisons |
nullopt if there were too many elements.
|
inline |
Try to emplace a new element in the map if there is not already one with the corresponding key.
Perfectly forwards the provided arguments into the constructor of the key and value if an appropriate element does not already exist.
| Args | The types of the initializers for the mapped type. Must satisfy std::is_constructible<Value, Args&&...>. |
| SfinaeKey | The key type, used to delete this overload if the key is not copy/move constructible |
| key | The key for which to insert or assign an element |
| args | The values with which to construct the mapped value |
true if the emplace happened. The first element will be an iterator pointing to the element corresponding to key : the existing element if the insert did not happen, or the new element if it did. contains(key) is true, or size()<Capacity, else ARENE_PRECONDITION violation. | Any | exception thrown by the comparisons or constructors of Key and Value . |
|
inline |
Try to emplace a new element in the map if there is not already one with the corresponding key.
Perfectly forwards the provided arguments into the constructor of the key and value if an appropriate element does not already exist.
| Args | The types of the initializers for the mapped type. Must satisfy std::is_constructible<Value, Args&&...>. |
| SfinaeKey | The key type, used to delete this overload if the key is not copy/move constructible |
| key | The key for which to insert or assign an element |
| args | The values with which to construct the mapped value |
true if the emplace happened. The first element will be an iterator pointing to the element corresponding to key : the existing element if the insert did not happen, or the new element if it did. contains(key) is true, or size()<Capacity, else ARENE_PRECONDITION violation. | Any | exception thrown by the comparisons or constructors of Key and Value . |
|
inline |
Try to emplace a new element in the map if there is not already one with an equivalent key.
Perfectly forwards the provided arguments into the constructor of the key and value if an appropriate element does not already exist.
| Args | The types of the initializers for the mapped type. Must satisfy std::is_constructible<Value, Args&&...>. |
| OtherKey | The key type. Must satisfy decays_to_v<K, Key> || transparent_comparison_supported<K> and std::is_constructible<Key, K&&> |
| key | The key for which to insert or assign an element |
| args | The values with which to construct the mapped value |
true if the emplace happened. The first element will be an iterator pointing to the element corresponding to key : the existing element if the insert did not happen, or the new element if it did. contains(key) is true, or size()<Capacity, else ARENE_PRECONDITION violation. | Any | exception thrown by the comparisons or constructors of Key and Value . |
|
inlinenoexcept |
Find the first element which is greater than a given key.
| key | The key to search for. |
key , or end() if there is no such element.
|
inlinenoexcept |
Find the first element which is greater than a given key.
| key | The key to search for. |
key , or end() if there is no such element.
|
inlinenoexcept |
Find the first element which is greater than a given key.
| OtherKey | the type of the key to find. Must satisfy is_transparent_comparator_for<Compare,Key,K> or is_transparent_three_way_comparator_for<Compare,Key,K> . |
| key | The key to search for. |
key , or end() if there is no such element.
|
inlinenoexcept |
Find the first element which is greater than a given key.
| OtherKey | the type of the key to find. Must satisfy is_transparent_comparator_for<Compare,Key,K> or is_transparent_three_way_comparator_for<Compare,Key,K> . |
| key | The key to search for. |
key , or end() if there is no such element.
|
friend |
|
friend |
Compares two maps for inequality of elements when mapped_value is not three-way-comparable.
| OtherCapacity | the capacity of rhs |
| SfinaeValue | dummy template parameter to disable the operator if value_type is not equality comparable. |
| SfinaeKey | dummy template parameter to enable the operator if key_Type is not three way comparable. |
| SfinaeMappedType | dummy template parameter to enable the operator if mapped_type is not three way comparable. |
| lhs | The left hand operand to the comparison. |
| rhs | The right hand operand to the comparison. |
!arene::base::equal(lhs.begin(),lhs.end(),rhs.begin(),rhs.end())
|
friend |
Compares two maps for equality of elements when mapped_value is not three-way-comparable.
| OtherCapacity | the capacity of rhs |
| SfinaeValue | dummy template parameter to disable the operator if value_type is not equality comparable. |
| SfinaeKey | dummy template parameter to enable the operator if key_type is not three way comparable. |
| SfinaeMappedType | dummy template parameter to enable the operator if mapped_type is not three way comparable. |
| lhs | The left hand operand to the comparison. |
| rhs | The right hand operand to the comparison. |
arene::base::equal(lhs.begin(),lhs.end(),rhs.begin(),rhs.end())
|
friend |
Gets the value at an index.
| Self | Deduced-this type of the map. |
| self | The map |
| index | the index in the map |
inline_map_reference_iterator
|
staticconstexpr |
map capacity
|
staticconstexpr |
Get the maximum number of elements in the map, Capacity.