[libcxx-commits] [PATCH] D117780: [libc++][test] add vector<bool>::reference tests
Arthur O'Dwyer via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Jan 29 08:40:59 PST 2022
Quuxplusone added inline comments.
================
Comment at: libcxx/test/std/containers/sequences/vector.bool/reference/ctor_copy.pass.cpp:22
+ Ref ref2 = ref;
+ assert(ref == ref2);
+
----------------
Quuxplusone wrote:
> This test feels insufficient — it's just testing that `ref2` refers to //some// `true` boolean, not that it refers to the //same// `vec[0]` "object" — but I have no great ideas for what would be better here. (We want to test `&ref == &ref2` but of course that doesn't work because `vector<bool>`.)
I guess what you could do here is
```
Ref ref2 = ref;
assert(ref == ref2 && ref2 == true);
ref.flip();
assert(ref == ref2 && ref2 == false);
```
No biggie.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117780/new/
https://reviews.llvm.org/D117780
More information about the libcxx-commits
mailing list