From d93a791305d7b323ad5061783ffc850f179b1c40 Mon Sep 17 00:00:00 2001 From: Tudor Bosman Date: Wed, 2 Dec 2015 08:57:22 -0800 Subject: [PATCH] Add Optional::value_type Summary: Comes in handy, and std::experimental::optional has it. Reviewed By: yfeldblum Differential Revision: D2708324 fb-gh-sync-id: 87cdf2449f356d3baf9fb56a608e9c43d8fe79ae --- folly/Optional.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/folly/Optional.h b/folly/Optional.h index 84f5d443..18320090 100644 --- a/folly/Optional.h +++ b/folly/Optional.h @@ -91,6 +91,8 @@ class OptionalEmptyException : public std::runtime_error { template class Optional { public: + typedef Value value_type; + static_assert(!std::is_reference::value, "Optional may not be used with reference types"); static_assert(!std::is_abstract::value, -- 2.34.1