Work around a bug in MSVC name lookup within templated friend contexts
authorChristopher Dykes <cdykes@fb.com>
Mon, 20 Nov 2017 21:44:02 +0000 (13:44 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 20 Nov 2017 22:05:37 +0000 (14:05 -0800)
Summary: MSVC has a bug that causes it to think that `once_flag` in this context resolves to the `using` statement further up, rather than `detail::once_flag`.

Reviewed By: yfeldblum

Differential Revision: D6376501

fbshipit-source-id: 481dbd75ed21f3d519bd920258fa743f314668ad

folly/synchronization/CallOnce.h

index 4d4bf0f..51543ea 100644 (file)
@@ -83,12 +83,12 @@ class once_flag {
 
   template <typename Mutex_, typename Callable, class... Args>
   friend void ::folly::call_once(
-      once_flag<Mutex_>& flag,
+      detail::once_flag<Mutex_>& flag,
       Callable&& f,
       Args&&... args);
   template <typename Mutex_, typename Callable, class... Args>
   friend void call_once_impl_no_inline(
-      once_flag<Mutex_>& flag,
+      detail::once_flag<Mutex_>& flag,
       Callable&& f,
       Args&&... args);