[libcxx-commits] [PATCH] D146066: [libc++][spaceship] Implement `operator<=>` for `queue`
Hristo Hristov via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Jun 1 14:01:19 PDT 2023
H-G-Hristov added inline comments.
================
Comment at: libcxx/test/support/test_container_comparisons.h:25
+template <typename T>
+class custom_container_iterator : public std::list<T>::iterator {};
+
----------------
Mordante wrote:
> Would it be possible to use `nasty_vector` from "nasty_containers.h" instead?
>
> You will need to add
> ```
> #if TEST_STD_VER >= 20
> template <class T>
> auto operator<=>(const nasty_vector<T>& x, const nasty_vector<T>& y) { return x.v_ <=> y.v_; }
> #endif
> ```
> but that seems easier than to add a new class.
Cool! I looked for off-the-shelf containers but couldn't find them.
FYI The `queue` supports `lists`. I guess the `stack` supports `vectors`. I'll use it there.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146066/new/
https://reviews.llvm.org/D146066
More information about the libcxx-commits
mailing list