From fe1ff9ef158019202de66685e787af1cd512b574 Mon Sep 17 00:00:00 2001 From: Dylan Yudaken Date: Mon, 20 Nov 2017 15:59:02 -0800 Subject: [PATCH] correct usage of namespace std for coroutines_trait specialization 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 | 6 +++--- folly/Optional.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/folly/Expected.h b/folly/Expected.h index dcdb378e..37963367 100644 --- a/folly/Expected.h +++ b/folly/Expected.h @@ -1519,13 +1519,13 @@ expected_detail::Awaitable } } // namespace folly -// This makes folly::Optional useable as a coroutine return type.. -FOLLY_NAMESPACE_STD_BEGIN +// This makes folly::Expected useable as a coroutine return type... +namespace std { namespace experimental { template struct coroutine_traits, Args...> { using promise_type = folly::expected_detail::Promise; }; } // namespace experimental -FOLLY_NAMESPACE_STD_END +} // namespace std #endif // FOLLY_HAS_COROUTINES diff --git a/folly/Optional.h b/folly/Optional.h index acd0b126..60ae2c73 100644 --- a/folly/Optional.h +++ b/folly/Optional.h @@ -645,12 +645,12 @@ detail::OptionalAwaitable } // namespace folly // This makes folly::Optional useable as a coroutine return type.. -FOLLY_NAMESPACE_STD_BEGIN +namespace std { namespace experimental { template struct coroutine_traits, Args...> { using promise_type = folly::detail::OptionalPromise; }; } // namespace experimental -FOLLY_NAMESPACE_STD_END +} // namespace std #endif // FOLLY_HAS_COROUTINES -- 2.34.1