Commit 59e4e1b5 authored by Jordan Rose's avatar Jordan Rose
Browse files

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.

llvm-svn: 218618
parent 40424cd6
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment