[PATCH] D85072: [ADT] Add getAsOr to Optional

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 1 21:26:15 PDT 2020


dblaikie added a comment.

I forget: Have we already decided that Optional won't be replaced by std::optional? If not, then would be good to not add API surface area that doesn't match std::optional (instead preferring non-member functions, for instance).

If that's already been decided in some previous reviews, etc, this sounds OK I guess. Probably doesn't need the enable_if, I'd have thought (could just let the implementation fail as usual - there aren't competing member functions, etc) & the parameter should be U&& to use with std::forward, avoid unnecessary copies, etc.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85072



More information about the llvm-commits mailing list