Commit 4fb9440e authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot

Ensure the allocator types in the string keyed tests have value_types matching...

Ensure the allocator types in the string keyed tests have value_types matching the value type of the collection

Summary:
Because MSVC's standard library implementation is now checking that this is actually the case:
```
error C2338: set<T, Compare, Allocator> requires that Allocator's value_type match T (See N4659 26.2.1 [container.requirements.general]/16 allocator_type) Either fix the allocator value_type or define _ENFORCE_MATCHING_ALLOCATORS=0 to suppress this diagnostic.
```

I've gone with the "Fix the `value_type`" approach.

Reviewed By: yfeldblum

Differential Revision: D5441017

fbshipit-source-id: b30403d2e48f815177cac29c4e6eec4e79583660
parent d8c4d15e
...@@ -110,21 +110,22 @@ private: ...@@ -110,21 +110,22 @@ private:
Alloc alloc_; Alloc alloc_;
}; };
typedef MemoryLeakCheckerAllocator<std::allocator<char>> KeyLeakChecker; using KeyValuePairLeakChecker = MemoryLeakCheckerAllocator<
typedef MemoryLeakCheckerAllocator< std::allocator<std::pair<const StringPiece, int>>>;
std::allocator<std::pair<const StringPiece, int>>> ValueLeakChecker; using ValueLeakChecker =
MemoryLeakCheckerAllocator<std::allocator<StringPiece>>;
typedef StringKeyedUnorderedMap< typedef StringKeyedUnorderedMap<
int, int,
folly::Hash, folly::Hash,
std::equal_to<StringPiece>, std::equal_to<StringPiece>,
ValueLeakChecker> KeyValuePairLeakChecker>
LeakCheckedUnorderedMap; LeakCheckedUnorderedMap;
typedef StringKeyedSetBase<std::less<StringPiece>, ValueLeakChecker> typedef StringKeyedSetBase<std::less<StringPiece>, ValueLeakChecker>
LeakCheckedSet; LeakCheckedSet;
typedef StringKeyedMap<int, std::less<StringPiece>, ValueLeakChecker> typedef StringKeyedMap<int, std::less<StringPiece>, KeyValuePairLeakChecker>
LeakCheckedMap; LeakCheckedMap;
using LeakCheckedUnorderedSet = BasicStringKeyedUnorderedSet< using LeakCheckedUnorderedSet = BasicStringKeyedUnorderedSet<
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment