Skip to content

Commit 1cc13ec

Browse files
multimap.ops
1 parent 1b932d6 commit 1cc13ec

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

libcxx/include/__tree

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2471,14 +2471,15 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) const {
24712471
while (__rt != nullptr) {
24722472
auto __comp_res = __comp(__k, __rt->__get_value());
24732473
if (__comp_res.__less()) {
2474-
__result = static_cast<__end_node_pointer>(__rt);
2475-
__rt = static_cast<__node_pointer>(__rt->__left_);
2474+
__result = std::__static_fancy_pointer_cast<__end_node_pointer>(__rt);
2475+
__rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__left_);
24762476
} else if (__comp_res.__greater())
2477-
__rt = static_cast<__node_pointer>(__rt->__right_);
2477+
__rt = std::__static_fancy_pointer_cast<__node_pointer>(__rt->__right_);
24782478
else
2479-
return _Pp(
2480-
__lower_bound_multi(__k, static_cast<__node_pointer>(__rt->__left_), static_cast<__end_node_pointer>(__rt)),
2481-
__upper_bound_multi(__k, static_cast<__node_pointer>(__rt->__right_), __result));
2479+
return _Pp(__lower_bound_multi(__k,
2480+
std::__static_fancy_pointer_cast<__node_pointer>(__rt->__left_),
2481+
std::__static_fancy_pointer_cast<__end_node_pointer>(__rt)),
2482+
__upper_bound_multi(__k, std::__static_fancy_pointer_cast<__node_pointer>(__rt->__right_), __result));
24822483
}
24832484
return _Pp(const_iterator(__result), const_iterator(__result));
24842485
}

libcxx/test/std/containers/associative/multimap/multimap.ops/count_transparent.pass.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,18 @@
1919
#include <map>
2020
#include <utility>
2121

22+
#include "test_macros.h"
23+
2224
struct Comp {
2325
using is_transparent = void;
2426

27+
TEST_CONSTEXPR_CXX26
2528
bool operator()(const std::pair<int, int>& lhs, const std::pair<int, int>& rhs) const { return lhs < rhs; }
2629

30+
TEST_CONSTEXPR_CXX26
2731
bool operator()(const std::pair<int, int>& lhs, int rhs) const { return lhs.first < rhs; }
2832

33+
TEST_CONSTEXPR_CXX26
2934
bool operator()(int lhs, const std::pair<int, int>& rhs) const { return lhs < rhs.first; }
3035
};
3136

libcxx/test/std/containers/associative/multimap/multimap.ops/equal_range_transparent.pass.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,18 @@
2424
#include <map>
2525
#include <utility>
2626

27+
#include "test_macros.h"
28+
2729
struct Comp {
2830
using is_transparent = void;
2931

32+
TEST_CONSTEXPR_CXX26
3033
bool operator()(const std::pair<int, int>& lhs, const std::pair<int, int>& rhs) const { return lhs < rhs; }
3134

35+
TEST_CONSTEXPR_CXX26
3236
bool operator()(const std::pair<int, int>& lhs, int rhs) const { return lhs.first < rhs; }
3337

38+
TEST_CONSTEXPR_CXX26
3439
bool operator()(int lhs, const std::pair<int, int>& rhs) const { return lhs < rhs.first; }
3540
};
3641

libcxx/test/std/containers/associative/multimap/multimap.ops/find.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "is_transparent.h"
2424

2525
template <class Iter>
26-
bool iter_in_range(Iter first, Iter last, Iter to_find) {
26+
TEST_CONSTEXPR_CXX26 bool iter_in_range(Iter first, Iter last, Iter to_find) {
2727
for (; first != last; ++first) {
2828
if (first == to_find)
2929
return true;

0 commit comments

Comments
 (0)