/*
- * 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.
#define FOLLY_MEMORY_H_
#include <folly/Traits.h>
+#include <folly/portability/Memory.h>
#include <cstddef>
#include <cstdlib>
* @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;
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();