9#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_INLINE_CONTAINER_MAP_HPP_
10#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_INLINE_CONTAINER_MAP_HPP_
24#include "arene/base/detail/exceptions.hpp"
25#include "arene/base/detail/iterator_interface.hpp"
26#include "arene/base/inline_container/detail/compare.hpp"
27#include "arene/base/inline_container/detail/container_base_type.hpp"
28#include "arene/base/inline_container/detail/index_array.hpp"
29#include "arene/base/inline_container/detail/lower_bound_index.hpp"
35#include "arene/base/stdlib_choice/cstddef.hpp"
36#include "arene/base/stdlib_choice/enable_if.hpp"
37#include "arene/base/stdlib_choice/forward.hpp"
38#include "arene/base/stdlib_choice/ignore.hpp"
39#include "arene/base/stdlib_choice/initializer_list.hpp"
40#include "arene/base/stdlib_choice/integer_sequence.hpp"
41#include "arene/base/stdlib_choice/integral_constant.hpp"
42#include "arene/base/stdlib_choice/is_assignable.hpp"
43#include "arene/base/stdlib_choice/is_const.hpp"
44#include "arene/base/stdlib_choice/is_constructible.hpp"
45#include "arene/base/stdlib_choice/is_copy_assignable.hpp"
46#include "arene/base/stdlib_choice/is_copy_constructible.hpp"
47#include "arene/base/stdlib_choice/is_default_constructible.hpp"
48#include "arene/base/stdlib_choice/is_integral.hpp"
49#include "arene/base/stdlib_choice/is_move_assignable.hpp"
50#include "arene/base/stdlib_choice/is_move_constructible.hpp"
51#include "arene/base/stdlib_choice/is_same.hpp"
52#include "arene/base/stdlib_choice/iterator_tags.hpp"
53#include "arene/base/stdlib_choice/move.hpp"
54#include "arene/base/stdlib_choice/pair.hpp"
55#include "arene/base/stdlib_choice/remove_reference.hpp"
56#include "arene/base/stdlib_choice/tuple.hpp"
77namespace inline_map_detail {
91template <
typename Key,
typename Value,
typename Compare = compare_three_way>
92class inline_map_base {
97 using mapped_type = Value;
99 using value_type = std::pair<Key const, Value>;
101 using compare_type = Compare;
109template <
class MapBase>
110class inline_map_passkey_base {
113 "'MapBase' must be an instantiation of 'inline_map_base'."
119 class inline_map_passkey {
123 explicit inline_map_passkey() =
default;
147template <
typename Key,
typename Value, std::
size_t Capacity,
typename Compare = compare_three_way>
150 :
public inline_map_detail::inline_map_base<Key, Value, Compare>
151 , inline_map_detail::inline_map_passkey_base<inline_map_detail::inline_map_base<Key, Value, Compare>>
152 , inline_container::detail::compare_wrapper<Compare, Key>
161 template <
typename OtherKey,
typename OtherValue, std::
size_t OtherCapacity,
typename OtherCompare>
168 template <
typename OtherKey>
174 template <
typename OtherKey>
175 static constexpr bool transparent_insertion_supported{
183 template <
typename OtherKey>
184 static constexpr bool
188 using comparator_base = inline_container::detail::compare_wrapper<Compare, Key>;
196 template <
typename OtherKey = Key>
197 static constexpr bool comparison_is_noexcept{comparator_base::template comparison_is_noexcept<OtherKey>};
200 using map_base_type = inline_map_detail::inline_map_base<Key, Value, Compare>;
206 using inline_map_passkey =
typename inline_map_detail::inline_map_passkey_base<map_base_type>::inline_map_passkey;
211 template <
bool IsConst>
213 :
public detail::iterator_interface<iterator_impl<IsConst>>
214 , inline_map_detail::inline_map_passkey_base<map_base_type> {
216 using iterator_interface = detail::iterator_interface<iterator_impl>;
219 using inline_map_passkey =
typename inline_map_detail::inline_map_passkey_base<map_base_type>::inline_map_passkey;
230 using non_const_iterator = iterator_impl<false>;
249 friend auto step_forward(detail::iterator_interface_tag, iterator_impl& iter)
noexcept ->
void { ++iter.pos_; }
254 friend auto step_backward(detail::iterator_interface_tag, iterator_impl& iter)
noexcept ->
void { --iter.pos_; }
264 iterator_impl() noexcept
270 iterator_impl(iterator_impl
const& other) =
default;
273 iterator_impl(iterator_impl&& other) =
default;
276 auto operator=(iterator_impl
const& other) -> iterator_impl& =
default;
279 auto operator=(iterator_impl&& other) -> iterator_impl& =
default;
282 ~iterator_impl() =
default;
288 iterator_impl(inline_map_passkey, map_type* map, index_type pos) noexcept
289 : iterator_interface{},
299 iterator_impl(implicit_conversion_type other) noexcept
301 inline_map_passkey{},
302 other.get_map(inline_map_passkey{}),
303 other.get_index(inline_map_passkey{})
308 using iterator_category = std::bidirectional_iterator_tag;
310 using value_type = std::pair<Key const, Value>;
325 auto operator*() const noexcept -> reference {
return *map_->entry_at_index(pos_); }
337 friend auto operator==(iterator_impl
const& lhs, iterator_impl
const& rhs)
noexcept ->
bool {
338 return lhs.pos_ == rhs.pos_;
348 auto is_iterator_for(map_type* map)
const noexcept ->
bool {
return map == map_; }
353 auto get_map(inline_map_passkey)
const noexcept -> map_type* {
return map_; }
358 auto get_index(inline_map_passkey)
const noexcept -> index_type {
return pos_; }
452 template <typename C = Compare, constraints<std::enable_if_t<std::is_default_constructible<C>::value>> =
nullptr>
464 template <typename C = Compare, constraints<std::enable_if_t<std::is_copy_constructible<C>::value>> =
nullptr>
478 typename C = Compare,
498 typename C = Compare,
506 if (other.size() > Capacity) {
522 typename C = Compare,
547 typename C = Compare,
557 if (other.size() > Capacity) {
576 typename C = Compare,
585 if (!res->insert_elements_if_they_fit(init_list)) {
605 typename C = Compare,
615 if (!res->insert_elements_if_they_fit(init_list)) {
643 typename C = Compare,
649 for (
auto const& element : init_list) {
671 typename C = Compare,
677 for (
auto const& element : init_list) {
687 : comparator_base{compare},
711 : comparator_base(
std::
move(static_cast<comparator_base&>(other))),
714 indices_(other.indices_),
715 values_(move_values(other,
std::make_index_sequence<Capacity>())) {}
730 typename SfinaeKey = Key,
731 typename SfinaeValue = Value,
732 typename SfinaeCompare = Compare,
742 for (
auto const& element : other) {
764 typename SfinaeKey = Key,
765 typename SfinaeValue = Value,
766 typename SfinaeCompare = Compare,
777 auto const clear_on_exit = clear_on_scope_exit(other);
779 for (
auto& element : other) {
802 auto operator=(copy_assign_source
const& other)
noexcept(
806 if (
this != &other) {
827 typename SfinaeKey = Key,
828 typename SfinaeValue = Value,
829 typename SfinaeCompare = Compare,
855 typename SfinaeKey = Key,
856 typename SfinaeValue = Value,
857 typename SfinaeCompare = Compare,
882 if (
this != &other) {
908 typename SfinaeKey = Key,
909 typename SfinaeValue = Value,
910 typename SfinaeCompare = Compare,
940 typename SfinaeKey = Key,
941 typename SfinaeValue = Value,
942 typename SfinaeCompare = Compare,
957 return comparator_base::get_comparator();
975 auto find(Key
const& key)
noexcept(comparison_is_noexcept<>) ->
iterator {
return do_find(*
this, key); }
980 auto find(Key
const& key)
const noexcept(comparison_is_noexcept<>) ->
const_iterator {
return do_find(*
this, key); }
987 template <
typename OtherKey, constra
ints<std::enable_if_t<transparent_comparison_supported<OtherKey>>> =
nullptr>
988 auto find(OtherKey
const& key)
noexcept(comparison_is_noexcept<OtherKey>) ->
iterator {
990 transparent_comparison_supported_for<OtherKey>,
991 "Compare must provide a valid comparison for (const Key&, const K&)"
993 return do_find(*
this, key);
1001 template <
typename OtherKey, constra
ints<std::enable_if_t<transparent_comparison_supported<OtherKey>>> =
nullptr>
1004 transparent_comparison_supported_for<OtherKey>,
1005 "Compare must provide a valid comparison for (const Key&, const K&)"
1007 return do_find(*
this, key);
1015 auto contains(Key
const& key)
const noexcept(comparison_is_noexcept<>) ->
bool {
return do_contains(key); }
1023 template <
typename OtherKey, constra
ints<std::enable_if_t<transparent_comparison_supported<OtherKey>>> =
nullptr>
1024 auto contains(OtherKey
const& key)
const noexcept(comparison_is_noexcept<OtherKey>) ->
bool {
1026 transparent_comparison_supported_for<OtherKey>,
1027 "Compare must provide a valid comparison for (const Key&, const K&)"
1029 return do_contains(key);
1036 auto count(Key
const& key)
const noexcept(comparison_is_noexcept<>) ->
size_type {
return do_count(key); }
1043 template <
typename OtherKey, constra
ints<std::enable_if_t<transparent_comparison_supported<OtherKey>>> =
nullptr>
1044 auto count(OtherKey
const& key)
const noexcept(comparison_is_noexcept<OtherKey>) ->
size_type {
1046 transparent_comparison_supported_for<OtherKey>,
1047 "Compare must provide a valid comparison for (const Key&, const K&)"
1049 return do_count(key);
1057 auto lower_bound(Key
const& key)
noexcept(comparison_is_noexcept<>) ->
iterator {
return do_lower_bound(*
this, key); }
1064 return do_lower_bound(*
this, key);
1072 template <
typename OtherKey, constra
ints<std::enable_if_t<transparent_comparison_supported<OtherKey>>> =
nullptr>
1075 transparent_comparison_supported_for<OtherKey>,
1076 "Compare must provide a valid comparison for (const Key&, const K&)"
1078 return do_lower_bound(*
this, key);
1087 template <
typename OtherKey, constra
ints<std::enable_if_t<transparent_comparison_supported<OtherKey>>> =
nullptr>
1090 transparent_comparison_supported_for<OtherKey>,
1091 "Compare must provide a valid comparison for (const Key&, const K&)"
1093 return do_lower_bound(*
this, key);
1100 auto upper_bound(Key
const& key)
noexcept(comparison_is_noexcept<>) ->
iterator {
return do_upper_bound(*
this, key); }
1107 return do_upper_bound(*
this, key);
1115 template <
typename OtherKey, constra
ints<std::enable_if_t<transparent_comparison_supported<OtherKey>>> =
nullptr>
1118 transparent_comparison_supported_for<OtherKey>,
1119 "Compare must provide a valid comparison for (const Key&, const K&)"
1121 return do_upper_bound(*
this, key);
1130 template <
typename OtherKey, constra
ints<std::enable_if_t<transparent_comparison_supported<OtherKey>>> =
nullptr>
1133 transparent_comparison_supported_for<OtherKey>,
1134 "Compare must provide a valid comparison for (const Key&, const K&)"
1136 return do_upper_bound(*
this, key);
1145 auto equal_range(Key
const& key)
noexcept(comparison_is_noexcept<>) -> std::pair<iterator, iterator> {
1146 return do_equal_range(*
this, key);
1154 auto equal_range(Key
const& key)
const noexcept(comparison_is_noexcept<>)
1155 -> std::pair<const_iterator, const_iterator> {
1156 return do_equal_range(*
this, key);
1166 template <
typename OtherKey, constra
ints<std::enable_if_t<transparent_comparison_supported<OtherKey>>> =
nullptr>
1167 auto equal_range(OtherKey
const& key)
noexcept(comparison_is_noexcept<OtherKey>) -> std::pair<iterator, iterator> {
1169 transparent_comparison_supported_for<OtherKey>,
1170 "Compare must provide a valid comparison for (const Key&, const K&)"
1172 return do_equal_range(*
this, key);
1182 template <
typename OtherKey, constra
ints<std::enable_if_t<transparent_comparison_supported<OtherKey>>> =
nullptr>
1183 auto equal_range(OtherKey
const& key)
const noexcept(comparison_is_noexcept<OtherKey>)
1184 -> std::pair<const_iterator, const_iterator> {
1186 transparent_comparison_supported_for<OtherKey>,
1187 "Compare must provide a valid comparison for (const Key&, const K&)"
1189 return do_equal_range(*
this, key);
1200 auto operator[](Key
const& key) -> Value& {
return do_operator_index(key); }
1219 transparent_comparison_supported_for<OtherKey>,
1220 "Compare must provide a valid comparison for (const Key&, const K&)"
1222 return do_operator_index(key);
1232 bool AreExceptionsEnabled = detail::are_exceptions_enabled::value,
1235 return do_at(*
this, key);
1244 bool AreExceptionsEnabled = detail::are_exceptions_enabled::value,
1247 return do_at(*
this, key);
1260 bool AreExceptionsEnabled = detail::are_exceptions_enabled::value,
1266 transparent_comparison_supported_for<OtherKey>,
1267 "Compare must provide a valid comparison for (const Key&, const K&)"
1269 return do_at(*
this, key);
1281 bool AreExceptionsEnabled = detail::are_exceptions_enabled::value,
1287 transparent_comparison_supported_for<OtherKey>,
1288 "Compare must provide a valid comparison for (const Key&, const K&)"
1290 return do_at(*
this, key);
1305 typename SfinaeKey = Key,
1306 typename SfinaeValue = Value,
1327 typename SfinaeKey = Key,
1328 typename SfinaeValue = Value,
1351 auto insert(P&& value) -> std::pair<iterator, bool> {
1370 typename OtherMapped,
1371 typename SfinaeKey = Key,
1376 auto insert_or_assign(Key
const& key, OtherMapped&& mapped_value) -> std::pair<iterator, bool> {
1394 typename OtherMapped,
1395 typename SfinaeKey = Key,
1420 typename OtherMapped,
1426 auto insert_or_assign(OtherKey&& key, OtherMapped&& mapped_value) -> std::pair<iterator, bool> {
1428 transparent_comparison_supported_for<OtherKey>,
1429 "Compare must provide a valid comparison for (const Key&, const K&)"
1450 typename SfinaeKey = Key,
1454 auto try_emplace(Key
const& key, Args&&... args) -> std::pair<iterator, bool> {
1473 typename SfinaeKey = Key,
1477 auto try_emplace(Key&& key, Args&&... args) -> std::pair<iterator, bool> {
1503 auto try_emplace(OtherKey&& key, Args&&... args) -> std::pair<iterator, bool> {
1505 transparent_comparison_supported_for<OtherKey>,
1506 "Compare must provide a valid comparison for (const Key&, const K&)"
1529 auto emplace(Args&&... args) -> std::pair<iterator, bool> {
1530 if (size_ == Capacity) {
1532 auto const existing_element =
find(temp.first);
1534 return {existing_element,
false};
1536 auto const new_index = indices_[size_];
1537 auto& potentially_inserted_element = values_[new_index];
1540 auto const pos_info = lower_bound_index(potentially_inserted_element->first);
1541 bool const do_insert{pos_info.order != strong_ordering::equal};
1543 insert_index_at(pos_info.index, new_index);
1544 destroy_if_not_inserted.dismiss();
1546 return {make_iterator(*
this, pos_info.index), do_insert};
1553 auto erase(Key
const& key)
noexcept(comparison_is_noexcept<>) ->
iterator {
return do_erase(key); }
1560 template <
typename OtherKey, constra
ints<std::enable_if_t<transparent_comparison_supported<OtherKey>>> =
nullptr>
1561 auto erase(OtherKey
const& key)
noexcept(comparison_is_noexcept<OtherKey>) ->
iterator {
1563 transparent_comparison_supported_for<OtherKey>,
1564 "Compare must provide a valid comparison for (const Key&, const K&)"
1566 return do_erase(key);
1578 return erase_at_index(pos.get_index(inline_map_passkey{}));
1590 return erase_at_index(pos.get_index(inline_map_passkey{}));
1604 auto const first_index = first.get_index(inline_map_passkey{});
1605 auto const last_index = last.get_index(inline_map_passkey{});
1606 return erase_index_range(first_index,
static_cast<index_type
>(last_index - first_index));
1613 for (index_type index{0U}; index < size_; ++index) {
1614 entry_at_index(index).reset();
1669 template <
size_type OtherCapacity>
1703 return ::arene::base::lexicographical_compare_three_way(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
1727 ::arene::base::equal(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
1751 return !(lhs == rhs);
1768 for (
auto const& element : init_list) {
1769 auto pos_info = lower_bound_index(element.first);
1770 if (pos_info.order == strong_ordering::equal) {
1773 if (
size() == Capacity) {
1776 std::ignore = insert_at(pos_info.index, element.first, element.second);
1785 auto entry_at_index(index_type index)
noexcept -> entry_type& {
return values_[indices_[index]]; }
1790 auto entry_at_index(index_type index)
const noexcept -> entry_type
const& {
return values_[indices_[index]]; }
1805 template <
typename Self, constra
ints<std::enable_if_t<decays_to_v<Self, inline_map>>> =
nullptr>
1808 return *self.entry_at_index(
static_cast<index_type
>(index));
1824 template <
typename OtherKey,
typename... Args>
1825 auto insert_at(index_type pos, OtherKey&& key, Args&&... args) -> entry_type& {
1827 index_type
const new_index{indices_[size_]};
1828 auto& entry = values_[new_index];
1834 insert_index_at(pos, new_index);
1841 void insert_index_at(index_type pos, index_type new_index)
noexcept {
1842 for (index_type i{size_}; i > pos; --i) {
1843 indices_[i] = indices_[
static_cast<index_type
>(i - 1U)];
1845 indices_[pos] = new_index;
1857 template <
typename OtherKey>
1858 auto lower_bound_index(OtherKey
const& key)
const noexcept(comparison_is_noexcept<OtherKey>)
1859 -> inline_container::detail::lower_bound_index_info<index_type> {
1860 auto const compare = [
this](
key_type const& lhs, OtherKey
const& rhs)
noexcept(comparison_is_noexcept<OtherKey>) {
1861 return this->key_ordering(lhs, rhs);
1863 auto const accessor = [
this](index_type
const index)
noexcept ->
key_type const& {
1864 return this->entry_at_index(index)->first;
1866 return inline_container::detail::lower_bound_index<key_type, OtherKey, index_type>(key, size_, compare, accessor);
1871 template <
typename Self>
1872 using self_iterator = iterator_impl<std::is_const<std::remove_reference_t<Self>>::value>;
1883 template <
typename Self, constra
ints<std::enable_if_t<decays_to_v<Self, inline_map>>> =
nullptr>
1884 static auto make_iterator(Self&& self, index_type index)
noexcept -> self_iterator<Self> {
1885 return {inline_map_passkey{}, &self, index};
1898 template <
typename Self, constra
ints<std::enable_if_t<decays_to_v<Self, inline_map>>> =
nullptr>
1899 static auto make_find_iterator(Self&& self, inline_container::detail::lower_bound_index_info<index_type> lb_info)
1900 -> self_iterator<Self> {
1901 if (lb_info.order == strong_ordering::equal) {
1914 template <
typename Self,
typename OtherKey, constra
ints<std::enable_if_t<decays_to_v<Self, inline_map>>> =
nullptr>
1915 static auto do_find(Self&& self, OtherKey
const& key)
noexcept(comparison_is_noexcept<OtherKey>)
1916 -> self_iterator<Self> {
1926 template <
typename OtherKey>
1927 auto do_contains(OtherKey
const& key)
const noexcept(comparison_is_noexcept<OtherKey>) ->
bool {
1928 return lower_bound_index(key).order == strong_ordering::equal;
1936 template <
typename OtherKey>
1937 auto do_count(OtherKey
const& key)
const noexcept(comparison_is_noexcept<OtherKey>) ->
std::size_t {
1938 return static_cast<std::size_t>(do_contains(key));
1951 template <
typename Self,
typename OtherKey, constra
ints<std::enable_if_t<decays_to_v<Self, inline_map>>> =
nullptr>
1952 static auto do_lower_bound(Self&& self, OtherKey
const& key)
noexcept(comparison_is_noexcept<OtherKey>)
1953 -> self_iterator<Self> {
1954 return make_iterator(self, self.lower_bound_index(key).index);
1967 template <
typename Self, constra
ints<std::enable_if_t<decays_to_v<Self, inline_map>>> =
nullptr>
1969 make_upper_bound_iterator(Self&& self, inline_container::detail::lower_bound_index_info<index_type> lb_info)
noexcept
1970 -> self_iterator<Self> {
1971 if (lb_info.order == strong_ordering::equal) {
1985 template <
typename Self,
typename OtherKey, constra
ints<std::enable_if_t<decays_to_v<Self, inline_map>>> =
nullptr>
1986 static auto do_upper_bound(Self&& self, OtherKey
const& key)
noexcept(comparison_is_noexcept<OtherKey>)
1987 -> self_iterator<Self> {
1988 return make_upper_bound_iterator(
std::forward<Self>(self), self.lower_bound_index(key));
1998 template <
typename Self, constra
ints<std::enable_if_t<decays_to_v<Self, inline_map>>> =
nullptr>
2000 make_equal_range_iterator(Self&& self, inline_container::detail::lower_bound_index_info<index_type> lb_info)
2001 -> std::pair<self_iterator<Self>, self_iterator<Self>> {
2016 template <
typename Self,
typename OtherKey, constra
ints<std::enable_if_t<decays_to_v<Self, inline_map>>> =
nullptr>
2017 static auto do_equal_range(Self&& self, OtherKey
const& key)
noexcept(comparison_is_noexcept<OtherKey>)
2018 -> std::pair<self_iterator<Self>, self_iterator<Self>> {
2019 return make_equal_range_iterator(
std::forward<Self>(self), self.lower_bound_index(key));
2029 template <
typename OtherKey>
2030 auto do_operator_index(OtherKey
const& key) -> Value& {
2031 auto pos_info = lower_bound_index(key);
2032 if (pos_info.order == strong_ordering::equal) {
2033 return entry_at_index(pos_info.index)->second;
2035 return insert_at(pos_info.index, key)->second;
2052 template <
typename Self,
typename OtherKey, constra
ints<std::enable_if_t<decays_to_v<Self, inline_map>>> =
nullptr>
2055 auto maybe_element = do_find(self, key);
2056 if (maybe_element == self.end()) {
2057 inline_map_detail::throw_out_of_range();
2059 return maybe_element->second;
2078 template <
typename OtherKey,
typename OtherMapped>
2079 auto do_insert_or_assign(OtherKey&& key, OtherMapped&& mapped_value) -> std::pair<iterator, bool> {
2100 template <
typename OtherKey,
typename... Args>
2101 auto do_try_emplace(OtherKey&& key, Args&&... args) -> std::pair<iterator, bool> {
2102 auto const pos_info = lower_bound_index(key);
2103 bool const needs_insert{pos_info.order != strong_ordering::equal};
2108 return {make_iterator(*
this, pos_info.index), needs_insert};
2117 template <
typename OtherKey>
2118 auto do_erase(OtherKey
const& key)
noexcept(comparison_is_noexcept<OtherKey>) ->
iterator {
2119 return erase_at_index(do_find(*
this, key).get_index(inline_map_passkey{}));
2126 auto erase_at_index(index_type index)
noexcept ->
iterator {
2127 return index < size_ ? erase_index_range(index, 1U) :
end();
2136 auto erase_index_range(index_type from, index_type erase_count)
noexcept ->
iterator {
2139 auto const last_index =
static_cast<index_type
>(from + erase_count);
2140 for (
auto index = from; index < last_index; ++index) {
2141 entry_at_index(index).reset();
2143 std::ignore = arene::base::rotate(indices_.begin() + from, indices_.begin() + last_index, indices_.begin() + size_);
2144 size_ =
static_cast<index_type
>(size_ - (last_index - from));
2146 return make_iterator(*
this, from);
2155 static auto move_value(entry_type& other
2173 ) -> array<entry_type, Capacity> {
2175 auto const clear_on_exit = clear_on_scope_exit(other);
2177 array<entry_type, Capacity> res{{move_value(other.values_[Indices])...}};
2186 template <std::
size_t OtherCapacity>
2201 auto reset_trailing_values_on_scope_exit(index_type
const end_index)
noexcept {
2203 for (index_type idx = this->size_; idx < end_index; ++idx) {
2204 this->entry_at_index(idx).reset();
2222 template <
typename OtherMap>
2223 void do_copy(OtherMap
const& other
2225 do_assignment(other);
2243 template <
typename OtherMap>
2244 void do_move(OtherMap&& other
2247 auto const clear_on_exit = clear_on_scope_exit(other);
2269 template <
typename OtherMap>
2270 void do_assignment(OtherMap&& other)
noexcept(
2276 auto const reset_trailing_values = reset_trailing_values_on_scope_exit(size_);
2279 while (size_ != other.size_) {
2289 index_type size_{0};
2291 array<index_type, Capacity> indices_{inline_container_detail::make_index_array<index_type, Capacity>()};
2294 array<entry_type, Capacity> values_{};
2303template <
typename Key,
typename Value, std::
size_t Capacity,
typename Compare>
2304constexpr std::integral_constant<typename inline_map<Key, Value, Capacity, Compare>::size_type, Capacity>
2307template <
typename Key,
typename Value, std::
size_t Capacity,
typename Compare>
2320template <
class Key,
class Value, std::
size_t Capacity,
class Compare>
2321struct container_base_type<
inline_map<Key, Value, Capacity, Compare>> {
2324 using type = inline_map_detail::inline_map_base<Key, Value, Compare>;
constexpr generic_ordering_from_three_way_compare_and_equals() noexcept=default
A container similar to std::map that has a fixed capacity.
Definition map.hpp:153
inline_map()=default
Construct the map with a default-constructed comparator and no elements.
auto erase(OtherKey const &key) noexcept(comparison_is_noexcept< OtherKey >) -> iterator
Erase the element with the corresponding key, if there is one.
Definition map.hpp:1561
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...
Definition map.hpp:1660
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.
Definition map.hpp:686
auto upper_bound(Key const &key) noexcept(comparison_is_noexcept<>) -> iterator
Find the first element which is greater than a given key.
Definition map.hpp:1100
value_type * pointer
The type of a pointer to the value type of the map.
Definition map.hpp:373
typename iterator::difference_type difference_type
The difference type of the map.
Definition map.hpp:394
auto operator[](Key const &key) -> Value &
Obtain a reference to the mapped value for the specified key.
Definition map.hpp:1200
typename map_base_type::key_type key_type
The key type of the map.
Definition map.hpp:365
~inline_map()=default
Default destructor.
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...
Definition map.hpp:1656
ARENE_NODISCARD auto cend() const noexcept -> const_iterator
Obtain an iterator referring to one past the last element in the sorted range of elements.
Definition map.hpp:1637
auto lower_bound(OtherKey const &key) noexcept(comparison_is_noexcept< OtherKey >) -> iterator
Find the first element which is not less than a given key.
Definition map.hpp:1073
ARENE_NODISCARD auto at(OtherKey const &key) const -> Value const &
Obtain a reference to the mapped value for the specified key or throw.
Definition map.hpp:1285
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.
Definition map.hpp:879
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.
Definition map.hpp:1310
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.
Definition map.hpp:482
auto operator=(inline_map< Key, Value, OtherCapacity, Compare > const &other) -> inline_map &
copy-assignment of a map with a smaller capacity.
Definition map.hpp:863
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 provide...
Definition map.hpp:675
ARENE_NODISCARD auto end() const noexcept -> const_iterator
Obtain an iterator referring to one past the last element in the sorted range of elements.
Definition map.hpp:1634
iterator_impl< false > iterator
The type of an iterator that provides non- const access to the elements.
Definition map.hpp:382
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 ...
Definition map.hpp:707
map_base_type inline_map_base_type
inline_map_base type
Definition map.hpp:402
ARENE_NODISCARD auto at(Key const &key) const -> Value const &
Obtain a reference to the mapped value for the specified key or throw.
Definition map.hpp:1246
ARENE_NODISCARD auto at(Key const &key) -> Value &
Obtain a reference to the mapped value for the specified key or throw.
Definition map.hpp:1234
friend class inline_map
Definition map.hpp:162
auto erase(iterator pos) noexcept -> iterator
Erase the element at the specified position.
Definition map.hpp:1575
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,...
Definition map.hpp:1376
void clear() noexcept
Destroy all elements in *this and set the size to zero.
Definition map.hpp:1612
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.
Definition map.hpp:465
ARENE_NODISCARD auto rbegin() noexcept -> reverse_iterator
Obtain an iterator referring to the beginning of a reversed traversal of the sorted range of elements...
Definition map.hpp:1641
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.
Definition map.hpp:1750
inline_map(inline_map< Key, Value, OtherCapacity, Compare > &&other)
Move from a map with a different capacity.
Definition map.hpp:773
friend auto value_at_index(inline_map_passkey, Self &self, std::size_t index) -> conditional_t< std::is_const< std::remove_reference_t< Self > >::value, value_type const &, value_type & >
Gets the value at an index.
Definition map.hpp:1806
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 ...
Definition map.hpp:647
value_type const & const_reference
The type of a const reference to the value type of the map.
Definition map.hpp:379
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.
Definition map.hpp:1351
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.
Definition map.hpp:1044
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,...
Definition map.hpp:1426
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 .
Definition map.hpp:1701
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.
Definition map.hpp:980
ARENE_NODISCARD auto begin() const noexcept -> const_iterator
Obtain an iterator referring to the beginning of the sorted range of elements.
Definition map.hpp:1624
auto upper_bound(Key const &key) const noexcept(comparison_is_noexcept<>) -> const_iterator
Find the first element which is greater than a given key.
Definition map.hpp:1106
ARENE_NODISCARD auto cbegin() const noexcept -> const_iterator
Obtain an iterator referring to the beginning of the sorted range of elements.
Definition map.hpp:1627
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 ...
Definition map.hpp:610
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.
Definition map.hpp:1725
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.
Definition map.hpp:1477
::arene::base::reverse_iterator< const_iterator > const_reverse_iterator
The type of an iterator that provides const access to the elements and iterates in reverse through th...
Definition map.hpp:391
ARENE_NODISCARD auto size() const noexcept -> size_type
Get the number of elements in the map.
Definition map.hpp:965
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.
Definition map.hpp:1131
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.
Definition map.hpp:1503
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.
Definition map.hpp:1671
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 th...
Definition map.hpp:1529
typename map_base_type::value_type value_type
The value type of the map.
Definition map.hpp:363
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.
Definition map.hpp:1063
auto operator=(dummy_move_assign_source &&) -> inline_map &=delete
Deleted move-assignment if the map should not be move-assignable.
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.
Definition map.hpp:453
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.
Definition map.hpp:1088
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.
Definition map.hpp:527
auto contains(Key const &key) const noexcept(comparison_is_noexcept<>) -> bool
Check if the set contains a specific key.
Definition map.hpp:1015
static constexpr std::integral_constant< size_type, Capacity > capacity
map capacity
Definition map.hpp:398
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.
Definition map.hpp:553
typename map_base_type::mapped_type mapped_type
The mapped type of the map.
Definition map.hpp:367
auto erase(const_iterator pos) noexcept -> iterator
Erase the element at the specified position.
Definition map.hpp:1587
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...
Definition map.hpp:1647
ARENE_NODISCARD auto begin() noexcept -> iterator
Obtain an iterator referring to the beginning of the sorted range of elements.
Definition map.hpp:1621
auto contains(OtherKey const &key) const noexcept(comparison_is_noexcept< OtherKey >) -> bool
Check if the set contains a key equivalent to a specific value.
Definition map.hpp:1024
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.
Definition map.hpp:1454
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.
Definition map.hpp:1002
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.
Definition map.hpp:1167
typename map_base_type::compare_type key_compare
The comparator of the map.
Definition map.hpp:369
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.
Definition map.hpp:802
ARENE_NODISCARD auto empty() const noexcept -> bool
Check if the map is empty.
Definition map.hpp:962
ARENE_NODISCARD auto at(OtherKey const &key) -> Value &
Obtain a reference to the mapped value for the specified key or throw.
Definition map.hpp:1264
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.
Definition map.hpp:988
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.
Definition map.hpp:1145
inline_map(inline_map< Key, Value, OtherCapacity, Compare > const &other)
Copy from a map with a different capacity.
Definition map.hpp:739
::arene::base::reverse_iterator< iterator > reverse_iterator
The type of an iterator that provides non- const access to the elements and iterates in reverse throu...
Definition map.hpp:388
static constexpr std::integral_constant< size_type, Capacity > max_size
Get the maximum number of elements in the map, Capacity.
Definition map.hpp:968
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...
Definition map.hpp:1652
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.
Definition map.hpp:1183
auto erase(const_iterator first, const_iterator last) noexcept -> iterator
Erase all the elements in the specified iterator range.
Definition map.hpp:1600
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.
Definition map.hpp:1332
typename map_base_type::size_type size_type
The size type of the map.
Definition map.hpp:371
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.
Definition map.hpp:1036
value_type const * const_pointer
The type of a const pointer to the value type of the map.
Definition map.hpp:375
auto erase(Key const &key) noexcept(comparison_is_noexcept<>) -> iterator
Erase the element with the corresponding key, if there is one.
Definition map.hpp:1553
ARENE_NODISCARD auto key_comp() const noexcept(std::is_nothrow_copy_constructible< Compare >::value) -> Compare
Obtain a copy of the comparator.
Definition map.hpp:956
iterator_impl< true > const_iterator
The type of an iterator that provides const access to the elements.
Definition map.hpp:384
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...
Definition map.hpp:1644
auto operator=(dummy_copy_assign_source const &) -> inline_map &=delete
Deleted copy-assignment if the map should not be copy-assignable.
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.
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.
Definition map.hpp:503
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.
Definition map.hpp:975
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,...
Definition map.hpp:1400
auto upper_bound(OtherKey const &key) noexcept(comparison_is_noexcept< OtherKey >) -> iterator
Find the first element which is greater than a given key.
Definition map.hpp:1116
auto operator[](OtherKey const &key) -> Value &
Obtain a reference to the mapped value for the specified key.
Definition map.hpp:1217
ARENE_NODISCARD auto end() noexcept -> iterator
Obtain an iterator referring to one past the last element in the sorted range of elements.
Definition map.hpp:1631
auto operator=(inline_map< Key, Value, OtherCapacity, Compare > &&other) -> inline_map &
Move-assignment of a map with a lesser capacity.
Definition map.hpp:948
value_type & reference
The type of a reference to the value type of the map.
Definition map.hpp:377
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 in...
Definition map.hpp:580
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.
Definition map.hpp:1154
auto lower_bound(Key const &key) noexcept(comparison_is_noexcept<>) -> iterator
Find the first element which is not less than a given key.
Definition map.hpp:1057
A special dummy class that cannot be constructed. It can be used as a substitute argument for copy/mo...
Definition non_constructible_dummy.hpp:16
A simple class that resets an optional value in its destructor, unless dismissed.
Definition optional_resetter.hpp:29
Implementation of std::optional for pre-C++17 compilers, and which replaces defined undefined behavio...
Definition optional.hpp:122
A backport of the constexpr std::reverse_iterator from C++17.
Definition reverse_iterator.hpp:188
Implementation of std::initializer_list for brace initialization.
Definition initializer_list.hpp:21
A helper class to represent a compile-time constant with the specified type and value....
Definition integral_constant.hpp:23
static constexpr value_type value
Definition integral_constant.hpp:34
Type trait to detect if a type is constructible from arguments of the specified types.
Definition is_constructible.hpp:29
a heterogeneous, fixed-size collection of values
Definition tuple.hpp:695
#define ARENE_PRECONDITION(condition)
Check that a precondition holds, and terminate the application if it does not.
Definition contract.hpp:150
Provides the decays_to_v<T, U> trait.
Provides implementation of a backport of C++20's version of std::equal.
Implementation of a backport of std::forward_like.
Provides backports of std::in_place_t, std::in_place_type_t, and std::in_place_index_t from C++17.
Provides implementation of arene::base::is_transparent_comparator_for.
Provides an implementation of a backport of std::lexicographical_compare from C++20.
Definition accumulate.hpp:37
constexpr auto move(InIterator first, InIterator last, OutIterator output) noexcept(noexcept(*first++) &&noexcept(output++) &&//CODEQLFP(EXP52-CPP) CODEQLFP(A5-2-6) noexcept(first !=last) &&//CODEQLFP(A5-2-6) std::is_nothrow_assignable<, typename std::iterator_traits< InIterator >::value_type >::value) -> OutIterator
Moves the elements in the range [first, last), to another range beginning at output,...
Definition move.hpp:46
constexpr bool is_instantiation_of_v
Definition is_instantiation_of.hpp:16
ARENE_NODISCARD constexpr auto next(Iterator itr, typename std::iterator_traits< Iterator >::difference_type steps=1) noexcept(noexcept(::arene::base::advance(itr, steps))) -> Iterator
Produces the Nth successor (or predecessor if steps is negative) of an iterator.
Definition next.hpp:38
strong_ordering_detail::strong_ordering strong_ordering
The enumeration specifying the result of an ordering comparison.
Definition strong_ordering.hpp:147
typename static_if< B >::template then_else< T, F > conditional_t
lazily select between two types based on a boolean condition
Definition conditional.hpp:28
constexpr auto distance(Iterator first, Iterator last) noexcept(noexcept(distance_impl::do_distance(first, last, typename std::iterator_traits< Iterator >::iterator_category{}))) -> typename std::iterator_traits< Iterator >::difference_type
Find the number of elements between first and last.
Definition distance.hpp:79
conditional_t<(MaxValue<=smallest_integer_for_detail::max_uint8), std::uint8_t, conditional_t<(MaxValue<=smallest_integer_for_detail::max_uint16), std::uint16_t, conditional_t<(MaxValue<=smallest_integer_for_detail::max_uint32), std::uint32_t, std::uint64_t > > > smallest_unsigned_integer_for
Calculates the smallest unsigned integer type that can be used to hold values up to and including Max...
Definition smallest_integer_for.hpp:38
constexpr bool is_transparent_comparator_v
Trait to determine if a given type is a transparent comparator.
ARENE_NODISCARD auto on_scope_exit(CallableType &&func) noexcept(std::is_nothrow_constructible< remove_cvref_t< CallableType >, CallableType >::value) -> scope_guard< remove_cvref_t< CallableType > >
Declarative helper for constructing scope_guard instances.
Definition scope_guard.hpp:122
constexpr bool is_transparent_three_way_comparator_for_v
Trait to determine if a given type is a transparent comparator that performs a three-way comparison f...
constexpr auto forward_like
A backport of C++23's std::forward_like, which allows forwarding a type with the same reference and c...
constexpr bool is_transparent_comparator_for_v
Trait to determine if a given type is a transparent comparator for a given set of operands.
typename constraints_impl::constraints< EnableIfs... >::type constraints
Helper used to express template constraints in a consistent way using std::enable_if_t.
Definition constraints.hpp:51
inequality_heuristic
An enumeration used for the return value of fast_inequality_check functions to indicate if two values...
Definition operators.hpp:696
@ may_be_equal_or_not_equal
The values checked may or may not be equal to each other; a more detailed check is required.
Definition operators.hpp:700
@ definitely_not_equal
The two values checked are definitely not equal to each other.
Definition operators.hpp:698
Definition accumulate.hpp:36
::ptrdiff_t ptrdiff_t
A type suitable for holding the difference between two pointers.
Definition cstddef.hpp:31
constexpr auto move(T &&value) noexcept -> remove_reference_t< T > &&
Cast a value to an rvalue.
Definition move.hpp:30
constexpr auto make_pair(T1 &&first, T2 &&second) noexcept(is_nothrow_constructible_v< pair_detail::deduced_pair_type_t< T1, T2 >, T1, T2 >) -> pair_detail::deduced_pair_type_t< T1, T2 >
Creates a std::pair object, deducing the target type from the types of arguments.
Definition pair.hpp:611
integer_sequence< size_t, Ints... > index_sequence
A helper alias template for integer_sequence<size_t, Ints>
Definition integer_sequence.hpp:218
::size_t size_t
A type suitable for holding the size of an object.
Definition cstddef.hpp:29
typename enable_if< Condition, Type >::type enable_if_t
Type alias to support constraining templates. Is an alias for the specified type if the Condition is ...
Definition enable_if.hpp:41
constexpr piecewise_construct_t piecewise_construct
Tag constant for piecewise construction.
Definition pair.hpp:42
static constexpr auto const & ignore
An object to which anything can be assigned, which ignores the assigned value.
Definition ignore.hpp:72
constexpr auto forward(remove_reference_t< T > &value) noexcept -> T &&
Cast a value to an rvalue if T is an rvalue or rvalue reference, otherwise forward an lvalue referenc...
Definition forward.hpp:24
#define ARENE_NODISCARD
An alias for [[nodiscard]] , or a no-op if the attribute is not supported.
Definition nodiscard.hpp:26
#define ARENE_NORETURN
An alias for [[noreturn]] , or a no-op if the attribute is not supported.
Definition noreturn.hpp:24
Provides a backport of the constexpr implementation of std::reverse_iterator .