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

Michael Schellenberger Costa via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Jan 29 01:54:21 PST 2020


miscco added a comment.

Comment about empty arrays



================
Comment at: libc/utils/CPP/Array.h:36
+
+  constexpr bool empty() const { return N == 0; }
+
----------------
This is not needed, as the expression `T Data[0]` is ill formed see [[ https://en.cppreference.com/w/c/language/array | C11 standard]]

Consequently, this should rather be replaced by a static_assert that `N != 0`


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