From 8376286aa6409db33b12d188cefc68f4afea06c1 Mon Sep 17 00:00:00 2001
From: Jan Eisenhauer <44572464+JanEisenhauer@users.noreply.github.com>
Date: Fri, 7 Jun 2019 11:52:44 +0200
Subject: [PATCH 1/6] With heterogeneous lookup, `equal_range` can result in a
range with length greater than 1.
---
include/boost/container/flat_set.hpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/boost/container/flat_set.hpp b/include/boost/container/flat_set.hpp
index 080beb5..4d4ae47 100644
--- a/include/boost/container/flat_set.hpp
+++ b/include/boost/container/flat_set.hpp
@@ -1031,7 +1031,7 @@ class flat_set
//! Complexity: Logarithmic
template
std::pair equal_range(const K& x)
- { return this->tree_t::lower_bound_range(x); }
+ { return this->tree_t::equal_range(x); }
//! Requires: This overload is available only if
//! key_compare::is_transparent exists.
@@ -1041,7 +1041,7 @@ class flat_set
//! Complexity: Logarithmic
template
std::pair equal_range(const K& x) const
- { return this->tree_t::lower_bound_range(x); }
+ { return this->tree_t::equal_range(x); }
#if defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
From 699b1e966d3f6124a4ad6fd7a528bbcc251d5a73 Mon Sep 17 00:00:00 2001
From: Jan Eisenhauer <44572464+JanEisenhauer@users.noreply.github.com>
Date: Fri, 7 Jun 2019 11:55:15 +0200
Subject: [PATCH 2/6] With heterogeneous lookup, `equal_range` can result in a
range with length greater than 1.
---
include/boost/container/flat_map.hpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/boost/container/flat_map.hpp b/include/boost/container/flat_map.hpp
index 2b52e14..7ef8c5f 100644
--- a/include/boost/container/flat_map.hpp
+++ b/include/boost/container/flat_map.hpp
@@ -1465,7 +1465,7 @@ class flat_map
//! Complexity: Logarithmic.
template
BOOST_CONTAINER_FORCEINLINE std::pair equal_range(const K& x)
- { return dtl::force_copy >(m_flat_tree.lower_bound_range(x)); }
+ { return dtl::force_copy >(m_flat_tree.equal_range(x)); }
//! Requires: This overload is available only if
//! key_compare::is_transparent exists.
@@ -1475,7 +1475,7 @@ class flat_map
//! Complexity: Logarithmic.
template
BOOST_CONTAINER_FORCEINLINE std::pair equal_range(const K& x) const
- { return dtl::force_copy >(m_flat_tree.lower_bound_range(x)); }
+ { return dtl::force_copy >(m_flat_tree.equal_range(x)); }
//! Effects: Extracts the internal sequence container.
//!
From 1aa15ead3513bd72deaac26d79240abe6ab62686 Mon Sep 17 00:00:00 2001
From: Jan Eisenhauer <44572464+JanEisenhauer@users.noreply.github.com>
Date: Tue, 11 Jun 2019 10:23:13 +0200
Subject: [PATCH 3/6] Add testcases for heterogeneous lookup with partial keys.
---
test/flat_map_test.cpp | 35 +++++++++++++++++++++++++++++++++++
test/flat_set_test.cpp | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 71 insertions(+)
diff --git a/test/flat_map_test.cpp b/test/flat_map_test.cpp
index 9497ee2..ca4ce1a 100644
--- a/test/flat_map_test.cpp
+++ b/test/flat_map_test.cpp
@@ -22,6 +22,7 @@
#include "../../intrusive/test/iterator_test.hpp"
#include