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

David Blaikie dblaikie at gmail.com
Fri Sep 26 15:02:21 PDT 2014


>>! In D5508#6, @jordan_rose wrote:
> We're using it internally in our own version of Optional; my guess would be that it would only be for projects that had stricter requirements than LLVM and Clang do (like lld, which requires MSVS 2012). However, I could add the fake-variadic up-to-six-arguments fallback for now.

I think it's probably reasonable for you to either keep it internally (not like it'll conflict with anything) or add the fake-variadic in line with other variadics in the LLVM codebase, so we don't have code that's just have a trap for the unwary.

(we also have some variadic helper utility class too - not sure what that one was for and whether it helps here - might be worth looking at (include/llvm/ADT/VariadicFunction.h)

http://reviews.llvm.org/D5508






More information about the llvm-commits mailing list