[llvm] r218617 - Add "typedef T value_type;" to llvm::Optional<T>.
Jordan Rose
jordan_rose at apple.com
Mon Sep 29 11:56:05 PDT 2014
Author: jrose
Date: Mon Sep 29 13:56:05 2014
New Revision: 218617
URL: http://llvm.org/viewvc/llvm-project?rev=218617&view=rev
Log:
Add "typedef T value_type;" to llvm::Optional<T>.
Inspired by std::experimental::optional from the "Library Fundamentals" C++ TS.
Modified:
llvm/trunk/include/llvm/ADT/Optional.h
Modified: llvm/trunk/include/llvm/ADT/Optional.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Optional.h?rev=218617&r1=218616&r2=218617&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/Optional.h (original)
+++ llvm/trunk/include/llvm/ADT/Optional.h Mon Sep 29 13:56:05 2014
@@ -29,6 +29,8 @@ class Optional {
AlignedCharArrayUnion<T> storage;
bool hasVal;
public:
+ typedef T value_type;
+
Optional(NoneType) : hasVal(false) {}
explicit Optional() : hasVal(false) {}
Optional(const T &y) : hasVal(true) {
More information about the llvm-commits
mailing list