/*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2015-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <glog/logging.h>
-#include <folly/Hash.h>
#include <folly/Range.h>
+#include <folly/hash/Hash.h>
#include <folly/portability/GFlags.h>
#include <folly/portability/GTest.h>
return alloc_ == other.alloc_;
}
-private:
+ private:
Alloc alloc_;
};
-typedef MemoryLeakCheckerAllocator<std::allocator<char>> KeyLeakChecker;
-typedef MemoryLeakCheckerAllocator<
- std::allocator<std::pair<const StringPiece, int>>> ValueLeakChecker;
+using KeyValuePairLeakChecker = MemoryLeakCheckerAllocator<
+ std::allocator<std::pair<const StringPiece, int>>>;
+using ValueLeakChecker =
+ MemoryLeakCheckerAllocator<std::allocator<StringPiece>>;
typedef StringKeyedUnorderedMap<
int,
folly::Hash,
std::equal_to<StringPiece>,
- ValueLeakChecker>
+ KeyValuePairLeakChecker>
LeakCheckedUnorderedMap;
typedef StringKeyedSetBase<std::less<StringPiece>, ValueLeakChecker>
LeakCheckedSet;
-typedef StringKeyedMap<int, std::less<StringPiece>, ValueLeakChecker>
+typedef StringKeyedMap<int, std::less<StringPiece>, KeyValuePairLeakChecker>
LeakCheckedMap;
using LeakCheckedUnorderedSet = BasicStringKeyedUnorderedSet<
EXPECT_TRUE(s3.empty());
EXPECT_TRUE(s6 == s5);
- LeakCheckedUnorderedSet s7(std::move(s6), s6.get_allocator());
+ auto s6_allocator = s6.get_allocator();
+ LeakCheckedUnorderedSet s7(std::move(s6), s6_allocator);
EXPECT_TRUE(s6.empty());
EXPECT_TRUE(s7 == s5);