folly: fix make_optional compliation issue with gnu++17
[folly.git] / folly / Optional.h
index 39abcc1c6db900ddc5a4118c0335dec55e115b98..ecce46e225ff0fc8befe28661ac7a43f3d017938 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2012-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 #pragma once
 
 /*
 #include <type_traits>
 #include <utility>
 
-#include <folly/Launder.h>
 #include <folly/Portability.h>
 #include <folly/Traits.h>
 #include <folly/Utility.h>
+#include <folly/lang/Launder.h>
 
 namespace folly {
 
@@ -87,7 +86,7 @@ typedef int detail::NoneHelper::*None;
 
 const None none = nullptr;
 
-class OptionalEmptyException : public std::runtime_error {
+class FOLLY_EXPORT OptionalEmptyException : public std::runtime_error {
  public:
   OptionalEmptyException()
       : std::runtime_error("Empty Optional cannot be unwrapped") {}
@@ -645,12 +644,12 @@ detail::OptionalAwaitable<Value>
 } // namespace folly
 
 // This makes folly::Optional<Value> useable as a coroutine return type..
-FOLLY_NAMESPACE_STD_BEGIN
+namespace std {
 namespace experimental {
 template <typename Value, typename... Args>
 struct coroutine_traits<folly::Optional<Value>, Args...> {
   using promise_type = folly::detail::OptionalPromise<Value>;
 };
 } // namespace experimental
-FOLLY_NAMESPACE_STD_END
+} // namespace std
 #endif // FOLLY_HAS_COROUTINES