[libcxx-commits] [PATCH] D126663: [libc++][test] Refactor SmallBasicString uses in range.lazy.split tests

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 30 09:18:34 PDT 2022


philnik accepted this revision as: philnik.
philnik added a comment.

LGTM % nit, but I think @var-const should take a look here.



================
Comment at: libcxx/test/std/ranges/range.adaptors/range.lazy.split/ctor.range.pass.cpp:75
 
-struct StrRange {
-  SmallString buffer_;
-  constexpr explicit StrRange() = default;
-  constexpr StrRange(const char* ptr) : buffer_(ptr) {}
-  constexpr const char* begin() const { return buffer_.begin(); }
-  constexpr const char* end() const { return buffer_.end(); }
-  constexpr bool operator==(const StrRange& rhs) const { return buffer_ == rhs.buffer_; }
-};
+using StrRange = std::string;
 static_assert( std::ranges::random_access_range<StrRange>);
----------------
I think it makes more sense to replace the occurrences of `StrRange` with `std::string`. Ditto for `string_view`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126663/new/

https://reviews.llvm.org/D126663



More information about the libcxx-commits mailing list