Add deduction guides for optional
llvm-svn: 333251
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: f35b4bc3954f3b01051fc0848535ff784809e9e2
diff --git a/include/optional b/include/optional
index 1f8e491..a76f8d1 100644
--- a/include/optional
+++ b/include/optional
@@ -139,6 +139,10 @@
private:
T *val; // exposition only
};
+
+template<class T>
+ optional(T) -> optional<T>;
+
} // namespace std
*/
@@ -1003,6 +1007,11 @@
}
};
+#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+template<class T>
+ optional(T) -> optional<T>;
+#endif
+
// Comparisons between optionals
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY constexpr