[libcxx-commits] [PATCH] D81174: [libcxx] Return "real" pointer from array<T, 0>::data.

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 4 09:53:16 PDT 2020


zoecarver created this revision.
zoecarver added reviewers: ldionne, EricWF, miscco.
Herald added subscribers: libcxx-commits, dexonsmith.
Herald added a project: libc++.
Herald added a reviewer: libc++.

Brings back the "union trick" so that we can stop returning nullptr from data and range methods. This patch adds two overloads of the union `__array_storage_wrapper`. One for trivially copyable types, and one for non-trivially copyable types (where we define a copy constructor).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81174

Files:
  libcxx/include/array
  libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp
  libcxx/test/std/containers/sequences/array/array.data/data_const.pass.cpp
  libcxx/test/std/containers/sequences/array/iterators.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81174.268511.patch
Type: text/x-patch
Size: 5589 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200604/4dea6a14/attachment.bin>


More information about the libcxx-commits mailing list