include glog for CHECK_EQ
[folly.git] / folly / Memory.h
index eadc1c816292db2e5802f46cebff3a78eaa807c7..69af41d175e5e57cd0502192854c9ebbb3c63f23 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
 #define FOLLY_MEMORY_H_
 
 #include <folly/Traits.h>
+#include <folly/portability/Memory.h>
 
 #include <cstddef>
 #include <cstdlib>
@@ -37,7 +38,8 @@ namespace folly {
  * @author Xu Ning (xning@fb.com)
  */
 
-#if __cplusplus >= 201402L
+#if __cplusplus >= 201402L || \
+    defined __cpp_lib_make_unique && __cpp_lib_make_unique >= 201304L
 
 /* using override */ using std::make_unique;
 
@@ -201,13 +203,11 @@ class StlAllocator {
   template <class U> StlAllocator(const StlAllocator<Alloc, U>& other)
     : alloc_(other.alloc()) { }
 
-  T* allocate(size_t n, const void* hint = nullptr) {
+  T* allocate(size_t n, const void* /* hint */ = nullptr) {
     return static_cast<T*>(alloc_->allocate(n * sizeof(T)));
   }
 
-  void deallocate(T* p, size_t n) {
-    alloc_->deallocate(p);
-  }
+  void deallocate(T* p, size_t /* n */) { alloc_->deallocate(p); }
 
   size_t max_size() const {
     return std::numeric_limits<size_t>::max();