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
This commit is contained in:
Avi Kivity
2024-01-21 20:46:07 +02:00
committed by Botond Dénes
parent a1867986e7
commit 9e8b65f587
2 changed files with 1 additions and 3 deletions

View File

@@ -188,7 +188,7 @@ BOOST_AUTO_TEST_CASE(test_vector_format) {
auto small_vector = utils::small_vector<int, 1>(ints);
test_format_range("small_vector", small_vector, ordered_strings);
auto chunked_vector = utils::chunked_vector<int, 131072>(ints);
auto chunked_vector = boost::copy_range<utils::chunked_vector<int, 131072>>(ints);
test_format_range("chunked_vector", chunked_vector, ordered_strings);
test_format_range("initializer_list", std::initializer_list<std::string>{"1", "2", "3"}, ordered_strings);

View File

@@ -106,8 +106,6 @@ public:
chunked_vector(chunked_vector&& x) noexcept;
template <typename Iterator>
chunked_vector(Iterator begin, Iterator end);
template <std::ranges::range Range>
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);