[libc-commits] [PATCH] D73530: [libc] Add a library of standalone C++ utilities.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Jan 29 13:49:56 PST 2020


sivachandra marked 8 inline comments as done.
sivachandra added inline comments.


================
Comment at: libc/utils/CPP/ArrayRef.h:65
+
+  MutableArrayRef() = default;
+
----------------
miscco wrote:
> All constructors defere to those of the base class so you should be able to use inheriting constructors aka:
> `using ArrayRef<T>::ArrayRef<T>`;
It was my mistake that I made them the same. They are not the same as the args are not `const` qualified in case of `MutableArrayRef`. See @abrachet's comment below.


================
Comment at: libc/utils/CPP/ArrayRef.h:86
+  iterator begin() const { return data(); }
+  iterator end() const { return data() + this->size(); }
+
----------------
abrachet wrote:
> Unnecessary `this->`
Strange, but this stackoverflow entry is the most accessible explanation I could find: https://stackoverflow.com/questions/19128796/why-can-i-call-base-template-class-method-from-derived-class


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73530





More information about the libc-commits mailing list