[libcxx-commits] [PATCH] D105597: [libcxx][nfc] Remove <variant>'s dependence on <array>.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 7 22:20:47 PDT 2021


Mordante added a comment.

In general LGTM. I'm only concerned about the case where`_Size == 0`.



================
Comment at: libcxx/include/variant:242
+struct __light_array {
+  _Tp __buff_[_Size] = {0};
+
----------------
Quuxplusone wrote:
> What is `_Tp` here? Are we sure `0` is convertible to `_Tp`? (Is `_Tp` always just `size_t`? That'd be super convenient. :))
> Are we sure `_Size` is never zero?
Since the variable is public please drop the trailing underscore. Small nit, I would prefer `__buf` instead of `__buff`, the latter looks weird to me.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105597



More information about the libcxx-commits mailing list