[libcxx-commits] [PATCH] D99854: [libcxx] adds `cpp17-.*iterator` concepts (as `__legacy_.*iterator`)

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 14 13:56:25 PDT 2021


ldionne added inline comments.


================
Comment at: libcxx/include/iterator:532
+concept __can_reference = requires {
+  typename __with_reference<_Tp>;
+};
----------------
I was surprised to see that we can't simply write `typename _Tp&`. I'm not sure what part of the concepts spec disallows it, do you know?

Would it make sense to rename this to `__referenceable`? Then below we would have

```
concept __dereferenceable = requires(_Tp& __t) {
  { *__t } -> __referenceable;
};
```

which I think is nicely consistent.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99854



More information about the libcxx-commits mailing list