Fix detection of std::make_unique under MSVC
authorChristopher Dykes <cdykes@fb.com>
Tue, 10 May 2016 00:15:22 +0000 (17:15 -0700)
committerFacebook Github Bot 6 <facebook-github-bot-6-bot@fb.com>
Tue, 10 May 2016 00:20:23 +0000 (17:20 -0700)
Summary: MSVC doesn't define `__cplusplus` as a high enough value to trigger this, so add an explicit check for MSVC instead.

Reviewed By: yfeldblum

Differential Revision: D3271647

fbshipit-source-id: a1e5a5a7eb75dce066dfc7fae8b2086880dc4c3d

folly/Memory.h

index 193d5062834931688ac4d502abcbf30734209f45..a64ca4c83db5e2ac732aacb4f87165ff1dcaa188 100644 (file)
@@ -37,8 +37,9 @@ namespace folly {
  * @author Xu Ning (xning@fb.com)
  */
 
-#if __cplusplus >= 201402L || \
-    defined __cpp_lib_make_unique && __cpp_lib_make_unique >= 201304L
+#if __cplusplus >= 201402L ||                                              \
+    (defined __cpp_lib_make_unique && __cpp_lib_make_unique >= 201304L) || \
+    (defined(_MSC_VER) && _MSC_VER >= 1900)
 
 /* using override */ using std::make_unique;