-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[libc++] constexpr flat_map #137453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[libc++] constexpr flat_map #137453
Conversation
@llvm/pr-subscribers-libcxx Author: Hui (huixie90) ChangesPatch is 296.18 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/137453.diff 82 Files Affected:
diff --git a/libcxx/include/__flat_map/flat_map.h b/libcxx/include/__flat_map/flat_map.h
index f5abfd0985280..452938595b7d4 100644
--- a/libcxx/include/__flat_map/flat_map.h
+++ b/libcxx/include/__flat_map/flat_map.h
@@ -115,11 +115,12 @@ class flat_map {
class value_compare {
private:
key_compare __comp_;
- _LIBCPP_HIDE_FROM_ABI value_compare(key_compare __c) : __comp_(__c) {}
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 value_compare(key_compare __c) : __comp_(__c) {}
friend flat_map;
public:
- _LIBCPP_HIDE_FROM_ABI bool operator()(const_reference __x, const_reference __y) const {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
+ operator()(const_reference __x, const_reference __y) const {
return __comp_(__x.first, __y.first);
}
};
@@ -138,14 +139,14 @@ class flat_map {
public:
// [flat.map.cons], construct/copy/destroy
- _LIBCPP_HIDE_FROM_ABI flat_map() noexcept(
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_map() noexcept(
is_nothrow_default_constructible_v<_KeyContainer> && is_nothrow_default_constructible_v<_MappedContainer> &&
is_nothrow_default_constructible_v<_Compare>)
: __containers_(), __compare_() {}
_LIBCPP_HIDE_FROM_ABI flat_map(const flat_map&) = default;
- _LIBCPP_HIDE_FROM_ABI flat_map(flat_map&& __other) noexcept(
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_map(flat_map&& __other) noexcept(
is_nothrow_move_constructible_v<_KeyContainer> && is_nothrow_move_constructible_v<_MappedContainer> &&
is_nothrow_move_constructible_v<_Compare>)
# if _LIBCPP_HAS_EXCEPTIONS
@@ -166,7 +167,7 @@ class flat_map {
template <class _Allocator>
requires __allocator_ctor_constraint<_Allocator>
- _LIBCPP_HIDE_FROM_ABI flat_map(const flat_map& __other, const _Allocator& __alloc)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_map(const flat_map& __other, const _Allocator& __alloc)
: flat_map(__ctor_uses_allocator_tag{},
__alloc,
__other.__containers_.keys,
@@ -175,7 +176,7 @@ class flat_map {
template <class _Allocator>
requires __allocator_ctor_constraint<_Allocator>
- _LIBCPP_HIDE_FROM_ABI flat_map(flat_map&& __other, const _Allocator& __alloc)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_map(flat_map&& __other, const _Allocator& __alloc)
# if _LIBCPP_HAS_EXCEPTIONS
try
# endif // _LIBCPP_HAS_EXCEPTIONS
@@ -192,7 +193,7 @@ class flat_map {
# endif // _LIBCPP_HAS_EXCEPTIONS
}
- _LIBCPP_HIDE_FROM_ABI flat_map(
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_map(
key_container_type __key_cont, mapped_container_type __mapped_cont, const key_compare& __comp = key_compare())
: __containers_{.keys = std::move(__key_cont), .values = std::move(__mapped_cont)}, __compare_(__comp) {
_LIBCPP_ASSERT_VALID_INPUT_RANGE(__containers_.keys.size() == __containers_.values.size(),
@@ -202,7 +203,7 @@ class flat_map {
template <class _Allocator>
requires __allocator_ctor_constraint<_Allocator>
- _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
flat_map(const key_container_type& __key_cont, const mapped_container_type& __mapped_cont, const _Allocator& __alloc)
: flat_map(__ctor_uses_allocator_tag{}, __alloc, __key_cont, __mapped_cont) {
_LIBCPP_ASSERT_VALID_INPUT_RANGE(__containers_.keys.size() == __containers_.values.size(),
@@ -212,7 +213,7 @@ class flat_map {
template <class _Allocator>
requires __allocator_ctor_constraint<_Allocator>
- _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
flat_map(const key_container_type& __key_cont,
const mapped_container_type& __mapped_cont,
const key_compare& __comp,
@@ -223,7 +224,7 @@ class flat_map {
__sort_and_unique();
}
- _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
flat_map(sorted_unique_t,
key_container_type __key_cont,
mapped_container_type __mapped_cont,
@@ -237,7 +238,7 @@ class flat_map {
template <class _Allocator>
requires __allocator_ctor_constraint<_Allocator>
- _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
flat_map(sorted_unique_t,
const key_container_type& __key_cont,
const mapped_container_type& __mapped_cont,
@@ -251,12 +252,12 @@ class flat_map {
template <class _Allocator>
requires __allocator_ctor_constraint<_Allocator>
- _LIBCPP_HIDE_FROM_ABI
- flat_map(sorted_unique_t,
- const key_container_type& __key_cont,
- const mapped_container_type& __mapped_cont,
- const key_compare& __comp,
- const _Allocator& __alloc)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_map(
+ sorted_unique_t,
+ const key_container_type& __key_cont,
+ const mapped_container_type& __mapped_cont,
+ const key_compare& __comp,
+ const _Allocator& __alloc)
: flat_map(__ctor_uses_allocator_tag{}, __alloc, __key_cont, __mapped_cont, __comp) {
_LIBCPP_ASSERT_VALID_INPUT_RANGE(__containers_.keys.size() == __containers_.values.size(),
"flat_map keys and mapped containers have different size");
@@ -264,21 +265,22 @@ class flat_map {
__is_sorted_and_unique(__containers_.keys), "Either the key container is not sorted or it contains duplicates");
}
- _LIBCPP_HIDE_FROM_ABI explicit flat_map(const key_compare& __comp) : __containers_(), __compare_(__comp) {}
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit flat_map(const key_compare& __comp)
+ : __containers_(), __compare_(__comp) {}
template <class _Allocator>
requires __allocator_ctor_constraint<_Allocator>
- _LIBCPP_HIDE_FROM_ABI flat_map(const key_compare& __comp, const _Allocator& __alloc)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_map(const key_compare& __comp, const _Allocator& __alloc)
: flat_map(__ctor_uses_allocator_empty_tag{}, __alloc, __comp) {}
template <class _Allocator>
requires __allocator_ctor_constraint<_Allocator>
- _LIBCPP_HIDE_FROM_ABI explicit flat_map(const _Allocator& __alloc)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit flat_map(const _Allocator& __alloc)
: flat_map(__ctor_uses_allocator_empty_tag{}, __alloc) {}
template <class _InputIterator>
requires __has_input_iterator_category<_InputIterator>::value
- _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
flat_map(_InputIterator __first, _InputIterator __last, const key_compare& __comp = key_compare())
: __containers_(), __compare_(__comp) {
insert(__first, __last);
@@ -286,7 +288,7 @@ class flat_map {
template <class _InputIterator, class _Allocator>
requires(__has_input_iterator_category<_InputIterator>::value && __allocator_ctor_constraint<_Allocator>)
- _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
flat_map(_InputIterator __first, _InputIterator __last, const key_compare& __comp, const _Allocator& __alloc)
: flat_map(__ctor_uses_allocator_empty_tag{}, __alloc, __comp) {
insert(__first, __last);
@@ -294,99 +296,105 @@ class flat_map {
template <class _InputIterator, class _Allocator>
requires(__has_input_iterator_category<_InputIterator>::value && __allocator_ctor_constraint<_Allocator>)
- _LIBCPP_HIDE_FROM_ABI flat_map(_InputIterator __first, _InputIterator __last, const _Allocator& __alloc)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
+ flat_map(_InputIterator __first, _InputIterator __last, const _Allocator& __alloc)
: flat_map(__ctor_uses_allocator_empty_tag{}, __alloc) {
insert(__first, __last);
}
template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI flat_map(from_range_t __fr, _Range&& __rg)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_map(from_range_t __fr, _Range&& __rg)
: flat_map(__fr, std::forward<_Range>(__rg), key_compare()) {}
template <_ContainerCompatibleRange<value_type> _Range, class _Allocator>
requires __allocator_ctor_constraint<_Allocator>
- _LIBCPP_HIDE_FROM_ABI flat_map(from_range_t, _Range&& __rg, const _Allocator& __alloc)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_map(from_range_t, _Range&& __rg, const _Allocator& __alloc)
: flat_map(__ctor_uses_allocator_empty_tag{}, __alloc) {
insert_range(std::forward<_Range>(__rg));
}
template <_ContainerCompatibleRange<value_type> _Range>
- _LIBCPP_HIDE_FROM_ABI flat_map(from_range_t, _Range&& __rg, const key_compare& __comp) : flat_map(__comp) {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_map(from_range_t, _Range&& __rg, const key_compare& __comp)
+ : flat_map(__comp) {
insert_range(std::forward<_Range>(__rg));
}
template <_ContainerCompatibleRange<value_type> _Range, class _Allocator>
requires __allocator_ctor_constraint<_Allocator>
- _LIBCPP_HIDE_FROM_ABI flat_map(from_range_t, _Range&& __rg, const key_compare& __comp, const _Allocator& __alloc)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
+ flat_map(from_range_t, _Range&& __rg, const key_compare& __comp, const _Allocator& __alloc)
: flat_map(__ctor_uses_allocator_empty_tag{}, __alloc, __comp) {
insert_range(std::forward<_Range>(__rg));
}
template <class _InputIterator>
requires __has_input_iterator_category<_InputIterator>::value
- _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
flat_map(sorted_unique_t, _InputIterator __first, _InputIterator __last, const key_compare& __comp = key_compare())
: __containers_(), __compare_(__comp) {
insert(sorted_unique, __first, __last);
}
template <class _InputIterator, class _Allocator>
requires(__has_input_iterator_category<_InputIterator>::value && __allocator_ctor_constraint<_Allocator>)
- _LIBCPP_HIDE_FROM_ABI
- flat_map(sorted_unique_t,
- _InputIterator __first,
- _InputIterator __last,
- const key_compare& __comp,
- const _Allocator& __alloc)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_map(
+ sorted_unique_t,
+ _InputIterator __first,
+ _InputIterator __last,
+ const key_compare& __comp,
+ const _Allocator& __alloc)
: flat_map(__ctor_uses_allocator_empty_tag{}, __alloc, __comp) {
insert(sorted_unique, __first, __last);
}
template <class _InputIterator, class _Allocator>
requires(__has_input_iterator_category<_InputIterator>::value && __allocator_ctor_constraint<_Allocator>)
- _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
flat_map(sorted_unique_t, _InputIterator __first, _InputIterator __last, const _Allocator& __alloc)
: flat_map(__ctor_uses_allocator_empty_tag{}, __alloc) {
insert(sorted_unique, __first, __last);
}
- _LIBCPP_HIDE_FROM_ABI flat_map(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
+ flat_map(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
: flat_map(__il.begin(), __il.end(), __comp) {}
template <class _Allocator>
requires __allocator_ctor_constraint<_Allocator>
- _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
flat_map(initializer_list<value_type> __il, const key_compare& __comp, const _Allocator& __alloc)
: flat_map(__il.begin(), __il.end(), __comp, __alloc) {}
template <class _Allocator>
requires __allocator_ctor_constraint<_Allocator>
- _LIBCPP_HIDE_FROM_ABI flat_map(initializer_list<value_type> __il, const _Allocator& __alloc)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
+ flat_map(initializer_list<value_type> __il, const _Allocator& __alloc)
: flat_map(__il.begin(), __il.end(), __alloc) {}
- _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
flat_map(sorted_unique_t, initializer_list<value_type> __il, const key_compare& __comp = key_compare())
: flat_map(sorted_unique, __il.begin(), __il.end(), __comp) {}
template <class _Allocator>
requires __allocator_ctor_constraint<_Allocator>
- _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
flat_map(sorted_unique_t, initializer_list<value_type> __il, const key_compare& __comp, const _Allocator& __alloc)
: flat_map(sorted_unique, __il.begin(), __il.end(), __comp, __alloc) {}
template <class _Allocator>
requires __allocator_ctor_constraint<_Allocator>
- _LIBCPP_HIDE_FROM_ABI flat_map(sorted_unique_t, initializer_list<value_type> __il, const _Allocator& __alloc)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
+ flat_map(sorted_unique_t, initializer_list<value_type> __il, const _Allocator& __alloc)
: flat_map(sorted_unique, __il.begin(), __il.end(), __alloc) {}
- _LIBCPP_HIDE_FROM_ABI flat_map& operator=(initializer_list<value_type> __il) {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_map& operator=(initializer_list<value_type> __il) {
clear();
insert(__il);
return *this;
}
- _LIBCPP_HIDE_FROM_ABI flat_map& operator=(const flat_map&) = default;
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_map& operator=(const flat_map&) = default;
- _LIBCPP_HIDE_FROM_ABI flat_map& operator=(flat_map&& __other) noexcept(
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 flat_map& operator=(flat_map&& __other) noexcept(
is_nothrow_move_assignable_v<_KeyContainer> && is_nothrow_move_assignable_v<_MappedContainer> &&
is_nothrow_move_assignable_v<_Compare>) {
// No matter what happens, we always want to clear the other container before returning
@@ -403,49 +411,65 @@ class flat_map {
}
// iterators
- _LIBCPP_HIDE_FROM_ABI iterator begin() noexcept {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator begin() noexcept {
return iterator(__containers_.keys.begin(), __containers_.values.begin());
}
- _LIBCPP_HIDE_FROM_ABI const_iterator begin() const noexcept {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator begin() const noexcept {
return const_iterator(__containers_.keys.begin(), __containers_.values.begin());
}
- _LIBCPP_HIDE_FROM_ABI iterator end() noexcept {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator end() noexcept {
return iterator(__containers_.keys.end(), __containers_.values.end());
}
- _LIBCPP_HIDE_FROM_ABI const_iterator end() const noexcept {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator end() const noexcept {
return const_iterator(__containers_.keys.end(), __containers_.values.end());
}
- _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() noexcept { return reverse_iterator(end()); }
- _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); }
- _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() noexcept { return reverse_iterator(begin()); }
- _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rbegin() noexcept {
+ return reverse_iterator(end());
+ }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator rbegin() const noexcept {
+ return const_reverse_iterator(end());
+ }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rend() noexcept {
+ return reverse_iterator(begin());
+ }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator rend() const noexcept {
+ return const_reverse_iterator(begin());
+ }
- _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const noexcept { return begin(); }
- _LIBCPP_HIDE_FROM_ABI const_iterator cend() const noexcept { return end(); }
- _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(end()); }
- _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const noexcept { return const_reverse_iterator(begin()); }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cbegin() const noexcept { return begin(); }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cend() const noexcept { return end(); }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crbegin() const noexcept {
+ return const_reverse_iterator(end());
+ }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crend() const noexcept {
+ return const_reverse_iterator(begin());
+ }
// [flat.map.capacity], capacity
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool empty() const noexcept { return __containers_.keys.empty(); }
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool empty() const noexcept {
+ return __containers_.keys.empty();
+ }
- _LIBCPP_HIDE_FROM_ABI size_type size() const noexcept { return __containers_.keys.size(); }
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type size() const noexcept {
+ return __containers_.keys.size();
+ }
- _LIBCPP_HIDE_FROM_ABI size_type max_size() const noexcept {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type max_size() const noexcept {
return std::min<size_type>(__containers_.keys.max_size(), __containers_.values.max_size());
}
// [flat.map.access], element access
- _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](const key_type& __x)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 mapped_type& operator[](const key_type& __x)
requires is_constructible_v<mapped_type>
{
return try_emplace(__x).first->second;
}
- _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](key_type&& __x)
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 mapped_type& operator[](key_type&& __x)
requires is_constructible_v<mapped_type>
{
return try_emplace(std::move(__x)).first->second;
@@ -454,11 +478,11 @@ class flat_map {
template <class _Kp>
requires(__is_compare_transparent && is_constructible_v<key_type, _Kp> && is_constructible_v<mapped_type> &&
!is_convertible_v<_Kp &&, const_iterator> && !is_convertible_v<_Kp &&, iterator>)
- _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](_Kp&& __x) {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 mapped_type& operator[](_Kp&& __x) {
return try_emplace(std::forward<_Kp>(__x)).first->second;
}
- _LIBCPP_HIDE_FROM_ABI mapped_type& at(const key_type& __x) {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 mapped_type& at(const key_type& __x) {
auto __it = find(__x);
if (__it == end()) {
std::__throw_out_of_range("flat_map::at(const key_type&): Key does not exist");
@@ -466,7 +490,7 @@ class flat_map {
return __it->second;
}
- _LIBCPP_HIDE_FROM_ABI const mapped_type& at(const key_type& __x) const {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const mapped_type& at(const key_type& __x) const {
auto __it = find(__x);
if (__it == end()) {
std::__throw_out_of_range("flat_map::at(const key_type&) const: Key does not exist");
@@ -476,7 +500,7 @@ class flat_map {
template <class _Kp>
requires __is_compare_transparent
- _LIBCPP_HIDE_FROM_ABI mapped_type& at(const _Kp& __x) {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 mapped_type& at(const _Kp& __x) {
auto __it = find(__x);
if (__it == end()) {
std::__throw_out_of_range("flat_map::at(const K&): Key does not exist");
@@ -486,7 +510,7 @@ class flat_map {
template <class _Kp>
requires __is_compare_transparent
- _LIBCPP_HIDE_FROM_ABI const mapped_type& at(const _Kp& __x) const {
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const mapped_type& at(const _Kp& __x) const {
auto __it = find(__x);
if (__it == end()) {
std::__throw_out_of_range("flat_map::at(const K&) const: Key does not exist");
@@ -497,45 +521,49 @@ class flat_map {
// [flat.map.modifiers], modifiers
template <class... _Args>
requires is_constructible_v<pair<key_type, mapped_type>, _Args......
[truncated]
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
export std.algorithm.ranges_sort | ||
export std.ranges.zip_view | ||
export std.tuple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No change requested. Do you have any idea why these missing exports were not caught before?
No description provided.