[PATCH] Add an emplace(...) method to llvm::Optional<T>.

David Blaikie dblaikie at gmail.com
Fri Sep 26 12:46:21 PDT 2014


================
Comment at: include/llvm/ADT/Optional.h:77
@@ +76,3 @@
+  template<typename ...ArgTypes>
+  void emplace(ArgTypes &&...Args) {
+    reset();
----------------
This is a tricky thing to upstream without a fallback. Do we have any other cases where we've added a variadic template without a fallback for non-variadic-template-supporting compilers? Without precedent I'd be a little hesitant to be the first example of that situation. Essentially no LLVM code would realistically use this API without a fallback, I'd imagine.

http://reviews.llvm.org/D5508






More information about the llvm-commits mailing list