Commit 06d2acdf authored by Nathan Bronson's avatar Nathan Bronson Committed by Facebook Github Bot

fix compilation issues on MSVC

Summary:
MSVC seems to have a bug when handling private classes that
are both part of the inheritence hierarchy (private superclass of a
superclass) and available as a template parameter, incorrectly claiming
that the class is inaccessible due to private inheritance. This diff
works around the issue. It also adds an explicit case to avoid a narrowing
warning generated by MSVC.

(Note: this ignores all push blocking failures!)

Reviewed By: yfeldblum, mjoras

Differential Revision: D19561643

fbshipit-source-id: 494d1611ce662a0eb6c441c64479d3c5d2bbd5b6
parent f85959d8
......@@ -1027,16 +1027,16 @@ class VectorContainerPolicy : public BasePolicy<
KeyEqualOrVoid,
AllocOrVoid,
uint32_t>;
using Alloc = typename Super::Alloc;
using Value = typename Super::Value;
using Alloc = Defaulted<AllocOrVoid, DefaultAlloc<Value>>;
using AllocTraits = typename Super::AllocTraits;
using ByteAlloc = typename Super::ByteAlloc;
using ByteAllocTraits = typename Super::ByteAllocTraits;
using BytePtr = typename Super::BytePtr;
using Hasher = typename Super::Hasher;
using Hasher = Defaulted<HasherOrVoid, DefaultHasher<Key>>;
using Item = typename Super::Item;
using ItemIter = typename Super::ItemIter;
using KeyEqual = typename Super::KeyEqual;
using Value = typename Super::Value;
using KeyEqual = Defaulted<KeyEqualOrVoid, DefaultKeyEqual<Key>>;
using Super::kAllocIsAlwaysEqual;
......
......@@ -1724,8 +1724,8 @@ class F14Table : public Policy {
// Use the source's capacity, unless it is oversized.
auto upperLimit = computeChunkCountAndScale(src.size(), false, false);
auto ccas =
std::make_pair(src.chunkMask_ + 1, src.chunks_->capacityScale());
auto ccas = std::make_pair(
std::size_t{src.chunkMask_} + 1, src.chunks_->capacityScale());
FOLLY_SAFE_DCHECK(
ccas.first >= upperLimit.first,
"rounded chunk count can't be bigger than actual");
......
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