Commit 278c88d5 authored by Nathan Bronson's avatar Nathan Bronson Committed by Facebook GitHub Bot

better fix for MSVC compilation issue

Summary:
This diff is a more complete fix for the problem addressed
by D19561643, in which private inheritance caused an incorrect
inaccessibility error for a type that was derived via an alternate
construction from a template param.

Reviewed By: lnicco

Differential Revision: D20718329

fbshipit-source-id: 778d246d07030f6abb9e08e127a98d48c736a7d7
parent d9fd5f23
...@@ -76,7 +76,7 @@ struct ObjectHolder { ...@@ -76,7 +76,7 @@ struct ObjectHolder {
}; };
template <char Tag, typename T> template <char Tag, typename T>
struct ObjectHolder<Tag, T, true> : private T { struct ObjectHolder<Tag, T, true> : T {
template <typename... Args> template <typename... Args>
ObjectHolder(Args&&... args) : T{std::forward<Args>(args)...} {} ObjectHolder(Args&&... args) : T{std::forward<Args>(args)...} {}
...@@ -1044,15 +1044,15 @@ class VectorContainerPolicy : public BasePolicy< ...@@ -1044,15 +1044,15 @@ class VectorContainerPolicy : public BasePolicy<
AllocOrVoid, AllocOrVoid,
uint32_t>; uint32_t>;
using Value = typename Super::Value; using Value = typename Super::Value;
using Alloc = Defaulted<AllocOrVoid, DefaultAlloc<Value>>; using Alloc = typename Super::Alloc;
using AllocTraits = typename Super::AllocTraits; using AllocTraits = typename Super::AllocTraits;
using ByteAlloc = typename Super::ByteAlloc; using ByteAlloc = typename Super::ByteAlloc;
using ByteAllocTraits = typename Super::ByteAllocTraits; using ByteAllocTraits = typename Super::ByteAllocTraits;
using BytePtr = typename Super::BytePtr; using BytePtr = typename Super::BytePtr;
using Hasher = Defaulted<HasherOrVoid, DefaultHasher<Key>>; using Hasher = typename Super::Hasher;
using Item = typename Super::Item; using Item = typename Super::Item;
using ItemIter = typename Super::ItemIter; using ItemIter = typename Super::ItemIter;
using KeyEqual = Defaulted<KeyEqualOrVoid, DefaultKeyEqual<Key>>; using KeyEqual = typename Super::KeyEqual;
using Super::kAllocIsAlwaysEqual; using Super::kAllocIsAlwaysEqual;
......
...@@ -403,8 +403,7 @@ struct alignas(kRequiredVectorAlignment) F14Chunk { ...@@ -403,8 +403,7 @@ struct alignas(kRequiredVectorAlignment) F14Chunk {
scale < (std::size_t{1} << kCapacityScaleBits), scale < (std::size_t{1} << kCapacityScaleBits),
""); "");
if (kCapacityScaleBits == 4) { if (kCapacityScaleBits == 4) {
control_ = control_ = static_cast<uint8_t>((control_ & ~0xf) | scale);
static_cast<uint8_t>((control_ & ~0xf) | static_cast<uint8_t>(scale));
} else { } else {
uint16_t v = static_cast<uint16_t>(scale); uint16_t v = static_cast<uint16_t>(scale);
std::memcpy(&tags_[12], &v, 2); std::memcpy(&tags_[12], &v, 2);
......
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