[PATCH] Add getValueOr to llvm::Optional<T>.

Jordan Rose jordan_rose at apple.com
Fri Sep 26 11:57:47 PDT 2014


Link added in description and here: [[ http://en.cppreference.com/w/cpp/experimental/optional | API ]], [[ http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4082.pdf | spec ]].

std::experimental::optional has the same signature but calls this operation `value_or`. We also have getValue (`value` in the TS), and getPointer and hasValue (no TS equivalent). I think I'd rather match what we're doing now, and switch everything together if we get to that point.

http://reviews.llvm.org/D5507






More information about the llvm-commits mailing list