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

Jordan Rose jordan_rose at apple.com
Fri Sep 26 11:59:18 PDT 2014


Hi dblaikie,

This can be used for in-place initialization of non-moveable types. Only available on compilers that support variadic templates.

Inspired by std::experimental::optional from the "Library Fundamentals" C++ TS ([[ http://en.cppreference.com/w/cpp/experimental/optional | API ]], [[ http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4082.pdf | spec ]]).

http://reviews.llvm.org/D5508

Files:
  include/llvm/ADT/Optional.h
  unittests/ADT/OptionalTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5508.14131.patch
Type: text/x-patch
Size: 2005 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140926/c554394c/attachment.bin>


More information about the llvm-commits mailing list