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

Guillaume Chatelet via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Jan 29 04:28:01 PST 2020


gchatelet marked an inline comment as done.
gchatelet added a comment.

+1 to @miscco 's comments
Other than that LGTM



================
Comment at: libc/utils/CPP/ArrayRef.h:80
+
+  T *data() const { return const_cast<T *>(ArrayRef<T>::data()); }
+
----------------
sivachandra wrote:
> gchatelet wrote:
> > [nit] It might be easier to start from `MutableArrayRef` as a base type and inherit from it to constrain constness?
> Thinking about `ArrayRef` and `MutableArrayRef` twists my mind. But, I am only imitating the LLVM arrangement for consistency. Consistency is probably good to avoid surprising ourselves when switching between different pieces of code.
SGTM


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