[libc-commits] [PATCH] D150211: [libc] Extend optional to support non trivially destructible objects

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Aug 11 15:14:06 PDT 2023


michaelrj added a comment.

This patch is looking a lot better. I think it should be good to go after dealing with the structs



================
Comment at: libc/src/__support/CPP/optional.h:37
+  template <typename U, bool = is_trivially_destructible<U>::value>
+  struct OptionalStorage {
     union {
----------------
michaelrj wrote:
> This struct shouldn't be named the same as the other, completely separate struct that inherits from `OptionalStorageBase`. It's very confusing to read.
Is it possible to condense these structs? It feels a bit overkill to have three structs when there are only two possible variations of the template (trivially destructible and not).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150211



More information about the libc-commits mailing list