[libcxx-commits] [PATCH] D80790: [libc++] Remove redundant empty specialization in std::array
Zoe Carver via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Fri May 29 10:55:16 PDT 2020
zoecarver added a comment.
What if we did this in three patches?
1. Update everything to use `data()` instead of `__elems_`.
2. Use `__array_storage` in both implementations.
3. Remove the `array<T, 0>` specialization.
It also might be good to move `data()` into `__array_storage` and hold an instance of `__array_storage` itself (the element storage would exist in `__array_storage`). That would make it easier to have many specialized overloads, i.e. one for `N = 0` where `T` is trivial, where `N = 0` and `T` is not trivial, and where `N != 0`. Then the `array` implementation only has to worry about implementing itself in terms of `data()`.
================
Comment at: libcxx/include/array:128
+namespace __detail {
+ template <typename _Tp, size_t _Size>
----------------
Do we use a `__detail` namespace anywhere else? I don't have an issue with it but, it seems a bit out of place.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80790/new/
https://reviews.llvm.org/D80790
More information about the libcxx-commits
mailing list