commit | 88c0ed30da6937146ffdcbc880053ba6ceacebbb | [log] [tgz] |
---|---|---|
author | Jordan Rose <jordan_rose@apple.com> | Mon Sep 29 18:56:08 2014 +0000 |
committer | Jordan Rose <jordan_rose@apple.com> | Mon Sep 29 18:56:08 2014 +0000 |
tree | 7af704c03e20df8e51c6e4973aae508d504a5874 | |
parent | ede14e3e21b528ca4a69c07d9e220db3057e2392 [diff] |
Add getValueOr to llvm::Optional<T>. This takes a single argument convertible to T, and - if the Optional has a value, returns the existing value, - otherwise, constructs a T from the argument and returns that. Inspired by std::experimental::optional from the "Library Fundamentals" C++ TS. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218618 91177308-0d34-0410-b5e6-96231b3b80d8