From 9e8b65f587eb2c2b0442e000791ef10b699654b1 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Sun, 21 Jan 2024 20:46:07 +0200 Subject: [PATCH] chunked_vector: remove range constructor Standard containers don't have constructors that take ranges; instead people use boost::copy_range or C++23 std::ranges::to. Make the API more uniform by removing this special constructor. The only caller, in a test, is adjusted. Closes scylladb/scylladb#16905 --- test/boost/string_format_test.cc | 2 +- utils/chunked_vector.hh | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/test/boost/string_format_test.cc b/test/boost/string_format_test.cc index ddbf14046c..20925e2312 100644 --- a/test/boost/string_format_test.cc +++ b/test/boost/string_format_test.cc @@ -188,7 +188,7 @@ BOOST_AUTO_TEST_CASE(test_vector_format) { auto small_vector = utils::small_vector(ints); test_format_range("small_vector", small_vector, ordered_strings); - auto chunked_vector = utils::chunked_vector(ints); + auto chunked_vector = boost::copy_range>(ints); test_format_range("chunked_vector", chunked_vector, ordered_strings); test_format_range("initializer_list", std::initializer_list{"1", "2", "3"}, ordered_strings); diff --git a/utils/chunked_vector.hh b/utils/chunked_vector.hh index bd84b00630..92c6850f4e 100644 --- a/utils/chunked_vector.hh +++ b/utils/chunked_vector.hh @@ -106,8 +106,6 @@ public: chunked_vector(chunked_vector&& x) noexcept; template chunked_vector(Iterator begin, Iterator end); - template - chunked_vector(const Range& r) : chunked_vector(r.begin(), r.end()) {} explicit chunked_vector(size_t n, const T& value = T()); ~chunked_vector(); chunked_vector& operator=(const chunked_vector& x);