<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi, all. For some projects, we've been working with a modified version of llvm::Optional<T> for some time now, many of them inspired by std::experimental::optional in the "Library Fundamentals" C++ TS. I'd like to see how everyone feels about pushing these changes back into master:<div><br></div><div>- Move assignment operator.</div><div>- getValueOr, which takes an argument convertible to T and returns the Optional's value, if it has one, or a T constructed from the argument if not<br>- A typedef for T under the name 'value_type'.<br>- For compilers with variadic templates, an "emplace" method for in-place initialization of non-moveable types.<br>- Implicit conversion from any type convertible to T. We used to <i>almost</i> have this everywhere via the operator=(const T &) overload, but that didn't include construction or (for compilers with variadic templates) multi-argument initialization. This is <i>not</i> a feature of std::experimental::optional, but we've found it useful.<br><br>The additions require no changes to LLVM or Clang, except the OptionalTests suite. There is one downside here: assignment of a T&& now requires an extra move, because otherwise we'd have ambiguous overloads for assignment of a type convertible to T. Is anyone depending on that?</div><div><br></div><div>Jordan</div><div><br></div><div></div></body></html>