Skip to content

Commit e0f56c0

Browse files
authored
[libc++] Make sure compare handle boolean-testable correctly
1 parent 206b42c commit e0f56c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libcxx/include/__flat_map/flat_map.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ class flat_map {
846846
__compare_(std::forward<_CompArg>(__comp)...) {}
847847

848848
_LIBCPP_HIDE_FROM_ABI bool __is_sorted_and_unique(auto&& __key_container) const {
849-
auto __greater_or_equal_to = [this](const auto& __x, const auto& __y) { return !__compare_(__x, __y); };
849+
auto __greater_or_equal_to = [this](const auto& __x, const auto& __y) -> bool { return !__compare_(__x, __y); };
850850
return ranges::adjacent_find(__key_container, __greater_or_equal_to) == ranges::end(__key_container);
851851
}
852852

@@ -870,7 +870,7 @@ class flat_map {
870870
auto __zv = ranges::views::zip(__containers_.keys, __containers_.values);
871871
auto __append_start_offset = __containers_.keys.size() - __num_of_appended;
872872
auto __end = __zv.end();
873-
auto __compare_key = [this](const auto& __p1, const auto& __p2) {
873+
auto __compare_key = [this](const auto& __p1, const auto& __p2) -> bool {
874874
return __compare_(std::get<0>(__p1), std::get<0>(__p2));
875875
};
876876
if constexpr (!_WasSorted) {

0 commit comments

Comments
 (0)