correct usage of namespace std for coroutines_trait specialization
authorDylan Yudaken <dylany@fb.com>
Mon, 20 Nov 2017 23:59:02 +0000 (15:59 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 21 Nov 2017 00:07:14 +0000 (16:07 -0800)
Summary: When specializing traits you should not use the libcpp inline std namespace, but rather the plain one.

Reviewed By: yfeldblum

Differential Revision: D6373787

fbshipit-source-id: d62ef9ccbf90c6f952db5f93f2377c920e68a809

folly/Expected.h
folly/Optional.h

index dcdb378e727acf2b3fb6d6b5fee72a933641f3d9..3796336788c6686f91f07d674630e7c44083db89 100644 (file)
@@ -1519,13 +1519,13 @@ expected_detail::Awaitable<Value, Error>
 }
 } // namespace folly
 
-// This makes folly::Optional<Value> useable as a coroutine return type..
-FOLLY_NAMESPACE_STD_BEGIN
+// This makes folly::Expected<Value> useable as a coroutine return type...
+namespace std {
 namespace experimental {
 template <typename Value, typename Error, typename... Args>
 struct coroutine_traits<folly::Expected<Value, Error>, Args...> {
   using promise_type = folly::expected_detail::Promise<Value, Error>;
 };
 } // namespace experimental
-FOLLY_NAMESPACE_STD_END
+} // namespace std
 #endif // FOLLY_HAS_COROUTINES
index acd0b1267d0b51ecdb94c7f57a8b34e85f91efa6..60ae2c735b1152ca2c883263c483b4ca229af386 100644 (file)
@@ -645,12 +645,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