replace "container_internal" with the shorter "priv"

This commit is contained in:
greg
2020-07-27 09:14:43 -04:00
parent 0fe48402ec
commit e77d86e49c
39 changed files with 261 additions and 749 deletions
+4 -4
View File
@@ -44,16 +44,16 @@
// create the parallel_flat_hash_map without internal mutexes, for when
// we programatically ensure that each thread uses different internal submaps
// --------------------------------------------------------------------------
#define EXTRAARGS , NMSP::container_internal::hash_default_hash<K>, \
NMSP::container_internal::hash_default_eq<K>, \
#define EXTRAARGS , NMSP::priv::hash_default_hash<K>, \
NMSP::priv::hash_default_eq<K>, \
std::allocator<std::pair<const K, V>>, 4, NMSP::NullMutex
#elif MT_SUPPORT == 2
// create the parallel_flat_hash_map with internal mutexes, for when
// we read/write the same parallel_flat_hash_map from multiple threads,
// without any special precautions.
// --------------------------------------------------------------------------
#define EXTRAARGS , NMSP::container_internal::hash_default_hash<K>, \
NMSP::container_internal::hash_default_eq<K>, \
#define EXTRAARGS , NMSP::priv::hash_default_hash<K>, \
NMSP::priv::hash_default_eq<K>, \
std::allocator<std::pair<const K, V>>, 4, MTX
#else
#define EXTRAARGS
+4 -4
View File
@@ -57,16 +57,16 @@
// create the parallel_flat_hash_map without internal mutexes, for when
// we programatically ensure that each thread uses different internal submaps
// --------------------------------------------------------------------------
#define EXTRAARGS , NMSP::container_internal::hash_default_hash<K>, \
NMSP::container_internal::hash_default_eq<K>, \
#define EXTRAARGS , NMSP::priv::hash_default_hash<K>, \
NMSP::priv::hash_default_eq<K>, \
std::allocator<std::pair<const K, V>>, 4, NMSP::NullMutex
#elif MT_SUPPORT == 2
// create the parallel_flat_hash_map with internal mutexes, for when
// we read/write the same parallel_flat_hash_map from multiple threads,
// without any special precautions.
// --------------------------------------------------------------------------
#define EXTRAARGS , NMSP::container_internal::hash_default_hash<K>, \
NMSP::container_internal::hash_default_eq<K>, \
#define EXTRAARGS , NMSP::priv::hash_default_hash<K>, \
NMSP::priv::hash_default_eq<K>, \
std::allocator<std::pair<const K, V>>, 4, MTX
#else
#define EXTRAARGS
+3 -3
View File
@@ -84,9 +84,9 @@ void test(const char *name, Perturb perturb1, Perturb perturb2)
template <class T, size_t N>
using pset = phmap::parallel_flat_hash_set<T,
phmap::container_internal::hash_default_hash<T>,
phmap::container_internal::hash_default_eq<T>,
phmap::container_internal::Allocator<T>, // alias for std::allocator
phmap::priv::hash_default_hash<T>,
phmap::priv::hash_default_eq<T>,
phmap::priv::Allocator<T>, // alias for std::allocator
N>;
// --------------------------------------------------------------------------
+2 -2
View File
@@ -265,8 +265,8 @@
</table>
<p>It is about time we provide the complete parallel_flat_hash_map class declaration (the declaration for parallel_flat_hash_set is similar):</p>
<pre><code>template &lt;class K, class V,
class Hash = absl::container_internal::hash_default_hash&lt;K&gt;,
class Eq = absl::container_internal::hash_default_eq&lt;K&gt;,
class Hash = absl::priv::hash_default_hash&lt;K&gt;,
class Eq = absl::priv::hash_default_eq&lt;K&gt;,
class Allocator = std::allocator&lt;std::pair&lt;const K, V&gt;&gt;,
size_t N = 4, // 2**N submaps
class Mutex = absl::NullMutex&gt; // use absl::Mutex to enable internal locks
+3 -3
View File
@@ -209,9 +209,9 @@ It is about time we provide the complete parallel_flat_hash_map class declaratio
```
template <class K, class V,
class Hash = phmap::container_internal::hash_default_hash<K>,
class Eq = phmap::container_internal::hash_default_eq<K>,
class Allocator = phmap::container_internal::Allocator<std::pair<const K, V>>, // alias for std::allocator
class Hash = phmap::priv::hash_default_hash<K>,
class Eq = phmap::priv::hash_default_eq<K>,
class Allocator = phmap::priv::Allocator<std::pair<const K, V>>, // alias for std::allocator
size_t N = 4, // 2**N submaps
class Mutex = phmap::NullMutex> // use std::mutex to enable internal locks
class parallel_flat_hash_map;
Vendored
+3 -3
View File
@@ -272,9 +272,9 @@
</table>
<p>It is about time we provide the complete parallel_flat_hash_map class declaration (the declaration for parallel_flat_hash_set is similar):</p>
<pre><code>template &lt;class K, class V,
class Hash = phmap::container_internal::hash_default_hash&lt;K&gt;,
class Eq = phmap::container_internal::hash_default_eq&lt;K&gt;,
class Allocator = phmap::container_internal::Allocator&lt;std::pair&lt;const K, V&gt;&gt;, // alias for std::allocator
class Hash = phmap::priv::hash_default_hash&lt;K&gt;,
class Eq = phmap::priv::hash_default_eq&lt;K&gt;,
class Allocator = phmap::priv::Allocator&lt;std::pair&lt;const K, V&gt;&gt;, // alias for std::allocator
size_t N = 4, // 2**N submaps
class Mutex = phmap::NullMutex&gt; // use std::mutex to enable internal locks
class parallel_flat_hash_map;
+23 -23
View File
@@ -737,7 +737,7 @@ namespace phmap {
namespace phmap {
namespace container_internal {
namespace priv {
// A helper class that indicates if the Compare parameter is a key-compare-to
// comparator.
@@ -921,7 +921,7 @@ namespace container_internal {
template <typename Key, typename Data, typename Compare, typename Alloc,
int TargetNodeSize, bool Multi>
struct map_params : common_params<Key, Compare, Alloc, TargetNodeSize, Multi,
phmap::container_internal::map_slot_policy<Key, Data>> {
phmap::priv::map_slot_policy<Key, Data>> {
using super_type = typename map_params::common_params;
using mapped_type = Data;
// This type allows us to move keys when it is safe to do so. It is safe
@@ -952,7 +952,7 @@ namespace container_internal {
};
// This type implements the necessary functions from the
// btree::container_internal::slot_type interface.
// btree::priv::slot_type interface.
template <typename Key>
struct set_slot_policy {
using slot_type = Key;
@@ -1102,7 +1102,7 @@ namespace container_internal {
btree_node() = default;
private:
using layout_type = phmap::container_internal::Layout<btree_node *, field_type,
using layout_type = phmap::priv::Layout<btree_node *, field_type,
slot_type, btree_node *>;
constexpr static size_type SizeWithNValues(size_type n) {
return (size_type)layout_type(/*parent*/ 1,
@@ -1227,10 +1227,10 @@ namespace container_internal {
btree_node *child(size_type i) const { return GetField<3>()[i]; }
btree_node *&mutable_child(size_type i) { return GetField<3>()[i]; }
void clear_child(size_type i) {
phmap::container_internal::SanitizerPoisonObject(&mutable_child(i));
phmap::priv::SanitizerPoisonObject(&mutable_child(i));
}
void set_child(size_type i, btree_node *c) {
phmap::container_internal::SanitizerUnpoisonObject(&mutable_child(i));
phmap::priv::SanitizerUnpoisonObject(&mutable_child(i));
mutable_child(i) = c;
c->set_position((field_type)i);
}
@@ -1396,7 +1396,7 @@ namespace container_internal {
n->set_start(0);
n->set_count(0);
n->set_max_count((field_type)max_count);
phmap::container_internal::SanitizerPoisonMemoryRegion(
phmap::priv::SanitizerPoisonMemoryRegion(
n->slot(0), max_count * sizeof(slot_type));
return n;
}
@@ -1405,7 +1405,7 @@ namespace container_internal {
// Set `max_count` to a sentinel value to indicate that this node is
// internal.
n->set_max_count(kInternalNodeMaxCount);
phmap::container_internal::SanitizerPoisonMemoryRegion(
phmap::priv::SanitizerPoisonMemoryRegion(
&n->mutable_child(0), (kNodeValues + 1) * sizeof(btree_node *));
return n;
}
@@ -1424,12 +1424,12 @@ namespace container_internal {
private:
template <typename... Args>
void value_init(const size_type i, allocator_type *alloc, Args &&... args) {
phmap::container_internal::SanitizerUnpoisonObject(slot(i));
phmap::priv::SanitizerUnpoisonObject(slot(i));
params_type::construct(alloc, slot(i), std::forward<Args>(args)...);
}
void value_destroy(const size_type i, allocator_type *alloc) {
params_type::destroy(alloc, slot(i));
phmap::container_internal::SanitizerPoisonObject(slot(i));
phmap::priv::SanitizerPoisonObject(slot(i));
}
// Move n values starting at value i in this node into the values starting at
@@ -1437,7 +1437,7 @@ namespace container_internal {
void uninitialized_move_n(const size_type n, const size_type i,
const size_type j, btree_node *x,
allocator_type *alloc) {
phmap::container_internal::SanitizerUnpoisonMemoryRegion(
phmap::priv::SanitizerUnpoisonMemoryRegion(
x->slot(j), n * sizeof(slot_type));
for (slot_type *src = slot(i), *end = src + n, *dest = x->slot(j);
src != end; ++src, ++dest) {
@@ -1982,7 +1982,7 @@ namespace container_internal {
// allocator.
node_type *allocate(const size_type size) {
return reinterpret_cast<node_type *>(
phmap::container_internal::Allocate<node_type::Alignment()>(
phmap::priv::Allocate<node_type::Alignment()>(
mutable_allocator(), (size_t)size));
}
@@ -2007,7 +2007,7 @@ namespace container_internal {
// Deallocates a node of a certain size in bytes using the allocator.
void deallocate(const size_type size, node_type *node) {
phmap::container_internal::Deallocate<node_type::Alignment()>(
phmap::priv::Deallocate<node_type::Alignment()>(
mutable_allocator(), node, (size_t)size);
}
@@ -2119,7 +2119,7 @@ namespace container_internal {
private:
// We use compressed tuple in order to save space because key_compare and
// allocator_type are usually empty.
phmap::container_internal::CompressedTuple<key_compare, allocator_type,
phmap::priv::CompressedTuple<key_compare, allocator_type,
node_type *>
root_;
@@ -3817,7 +3817,7 @@ namespace container_internal {
btree_multimap_container() {}
};
} // namespace container_internal
} // namespace priv
@@ -3825,8 +3825,8 @@ namespace container_internal {
// btree_set - default values in phmap_fwd_decl.h
// ----------------------------------------------------------------------
template <typename Key, typename Compare, typename Alloc>
class btree_set : public container_internal::btree_set_container<
container_internal::btree<container_internal::set_params<
class btree_set : public priv::btree_set_container<
priv::btree<priv::set_params<
Key, Compare, Alloc, /*TargetNodeSize=*/ 256, /*Multi=*/ false>>>
{
using Base = typename btree_set::btree_set_container;
@@ -3882,8 +3882,8 @@ namespace container_internal {
// btree_multiset - default values in phmap_fwd_decl.h
// ----------------------------------------------------------------------
template <typename Key, typename Compare, typename Alloc>
class btree_multiset : public container_internal::btree_multiset_container<
container_internal::btree<container_internal::set_params<
class btree_multiset : public priv::btree_multiset_container<
priv::btree<priv::set_params<
Key, Compare, Alloc, /*TargetNodeSize=*/ 256, /*Multi=*/ true>>>
{
using Base = typename btree_multiset::btree_multiset_container;
@@ -3940,8 +3940,8 @@ namespace container_internal {
// btree_map - default values in phmap_fwd_decl.h
// ----------------------------------------------------------------------
template <typename Key, typename Value, typename Compare, typename Alloc>
class btree_map : public container_internal::btree_map_container<
container_internal::btree<container_internal::map_params<
class btree_map : public priv::btree_map_container<
priv::btree<priv::map_params<
Key, Value, Compare, Alloc, /*TargetNodeSize=*/ 256, /*Multi=*/ false>>>
{
using Base = typename btree_map::btree_map_container;
@@ -3999,8 +3999,8 @@ namespace container_internal {
// btree_multimap - default values in phmap_fwd_decl.h
// ----------------------------------------------------------------------
template <typename Key, typename Value, typename Compare, typename Alloc>
class btree_multimap : public container_internal::btree_multimap_container<
container_internal::btree<container_internal::map_params<
class btree_multimap : public priv::btree_multimap_container<
priv::btree<priv::map_params<
Key, Value, Compare, Alloc, /*TargetNodeSize=*/ 256, /*Multi=*/ true>>>
{
using Base = typename btree_multimap::btree_multimap_container;
+44 -44
View File
@@ -74,7 +74,7 @@
namespace phmap {
namespace container_internal {
namespace priv {
// --------------------------------------------------------------------------
template <size_t Width>
@@ -183,10 +183,10 @@ public:
explicit operator bool() const { return mask_ != 0; }
int operator*() const { return LowestBitSet(); }
int LowestBitSet() const {
return container_internal::TrailingZeros(mask_) >> Shift;
return priv::TrailingZeros(mask_) >> Shift;
}
int HighestBitSet() const {
return (sizeof(T) * CHAR_BIT - container_internal::LeadingZeros(mask_) -
return (sizeof(T) * CHAR_BIT - priv::LeadingZeros(mask_) -
1) >>
Shift;
}
@@ -195,13 +195,13 @@ public:
BitMask end() const { return BitMask(0); }
int TrailingZeros() const {
return container_internal::TrailingZeros(mask_) >> Shift;
return priv::TrailingZeros(mask_) >> Shift;
}
int LeadingZeros() const {
constexpr int total_significant_bits = SignificantBits << Shift;
constexpr int extra_bits = sizeof(T) * 8 - total_significant_bits;
return container_internal::LeadingZeros(mask_ << extra_bits) >> Shift;
return priv::LeadingZeros(mask_ << extra_bits) >> Shift;
}
private:
@@ -796,7 +796,7 @@ private:
auto KeyTypeCanBeHashed(const Hash& h, const key_type& k) -> decltype(h(k));
auto KeyTypeCanBeEq(const Eq& eq, const key_type& k) -> decltype(eq(k, k));
using Layout = phmap::container_internal::Layout<ctrl_t, slot_type>;
using Layout = phmap::priv::Layout<ctrl_t, slot_type>;
static Layout MakeLayout(size_t capacity) {
assert(IsValidCapacity(capacity));
@@ -1652,7 +1652,7 @@ public:
private:
template <class Container, typename Enabler>
friend struct phmap::container_internal::hashtable_debug_internal::HashtableDebugAccess;
friend struct phmap::priv::hashtable_debug_internal::HashtableDebugAccess;
struct FindElement
{
@@ -2100,7 +2100,7 @@ private:
size_t size_ = 0; // number of full slots
size_t capacity_ = 0; // total number of slots
HashtablezInfoHandle infoz_;
phmap::container_internal::CompressedTuple<size_t /* growth_left */, hasher,
phmap::priv::CompressedTuple<size_t /* growth_left */, hasher,
key_equal, allocator_type>
settings_{0, hasher{}, key_equal{}, allocator_type{}};
};
@@ -3124,7 +3124,7 @@ public:
private:
template <class Container, typename Enabler>
friend struct phmap::container_internal::hashtable_debug_internal::HashtableDebugAccess;
friend struct phmap::priv::hashtable_debug_internal::HashtableDebugAccess;
struct FindElement
{
@@ -3583,10 +3583,10 @@ struct FlatHashSetPolicy
static T& element(slot_type* slot) { return *slot; }
template <class F, class... Args>
static decltype(phmap::container_internal::DecomposeValue(
static decltype(phmap::priv::DecomposeValue(
std::declval<F>(), std::declval<Args>()...))
apply(F&& f, Args&&... args) {
return phmap::container_internal::DecomposeValue(
return phmap::priv::DecomposeValue(
std::forward<F>(f), std::forward<Args>(args)...);
}
@@ -3598,7 +3598,7 @@ struct FlatHashSetPolicy
template <class K, class V>
struct FlatHashMapPolicy
{
using slot_policy = container_internal::map_slot_policy<K, V>;
using slot_policy = priv::map_slot_policy<K, V>;
using slot_type = typename slot_policy::slot_type;
using key_type = K;
using mapped_type = V;
@@ -3621,10 +3621,10 @@ struct FlatHashMapPolicy
}
template <class F, class... Args>
static decltype(phmap::container_internal::DecomposePair(
static decltype(phmap::priv::DecomposePair(
std::declval<F>(), std::declval<Args>()...))
apply(F&& f, Args&&... args) {
return phmap::container_internal::DecomposePair(std::forward<F>(f),
return phmap::priv::DecomposePair(std::forward<F>(f),
std::forward<Args>(args)...);
}
@@ -3680,7 +3680,7 @@ struct node_hash_policy {
// --------------------------------------------------------------------------
template <class T>
struct NodeHashSetPolicy
: phmap::container_internal::node_hash_policy<T&, NodeHashSetPolicy<T>>
: phmap::priv::node_hash_policy<T&, NodeHashSetPolicy<T>>
{
using key_type = T;
using init_type = T;
@@ -3707,10 +3707,10 @@ struct NodeHashSetPolicy
}
template <class F, class... Args>
static decltype(phmap::container_internal::DecomposeValue(
static decltype(phmap::priv::DecomposeValue(
std::declval<F>(), std::declval<Args>()...))
apply(F&& f, Args&&... args) {
return phmap::container_internal::DecomposeValue(
return phmap::priv::DecomposeValue(
std::forward<F>(f), std::forward<Args>(args)...);
}
@@ -3721,7 +3721,7 @@ struct NodeHashSetPolicy
// --------------------------------------------------------------------------
template <class Key, class Value>
class NodeHashMapPolicy
: public phmap::container_internal::node_hash_policy<
: public phmap::priv::node_hash_policy<
std::pair<const Key, Value>&, NodeHashMapPolicy<Key, Value>>
{
using value_type = std::pair<const Key, Value>;
@@ -3753,10 +3753,10 @@ public:
}
template <class F, class... Args>
static decltype(phmap::container_internal::DecomposePair(
static decltype(phmap::priv::DecomposePair(
std::declval<F>(), std::declval<Args>()...))
apply(F&& f, Args&&... args) {
return phmap::container_internal::DecomposePair(std::forward<F>(f),
return phmap::priv::DecomposePair(std::forward<F>(f),
std::forward<Args>(args)...);
}
@@ -3881,8 +3881,8 @@ struct HashtableDebugAccess<Set, phmap::void_t<typename Set::raw_hash_set>>
size_t hash = typename Set::HashElement{set.hash_ref()}(key);
auto seq = set.probe(hash);
while (true) {
container_internal::Group g{set.ctrl_ + seq.offset()};
for (int i : g.Match(container_internal::H2(hash))) {
priv::Group g{set.ctrl_ + seq.offset()};
for (int i : g.Match(priv::H2(hash))) {
if (Traits::apply(
typename Set::template EqualElement<typename Set::key_type>{
key, set.eq_ref()},
@@ -3907,7 +3907,7 @@ struct HashtableDebugAccess<Set, phmap::void_t<typename Set::raw_hash_set>>
m += per_slot * c.size();
} else {
for (size_t i = 0; i != capacity; ++i) {
if (container_internal::IsFull(c.ctrl_[i])) {
if (priv::IsFull(c.ctrl_[i])) {
m += Traits::space_used(c.slots_ + i);
}
}
@@ -3929,7 +3929,7 @@ struct HashtableDebugAccess<Set, phmap::void_t<typename Set::raw_hash_set>>
};
} // namespace hashtable_debug_internal
} // namespace container_internal
} // namespace priv
// -----------------------------------------------------------------------------
// phmap::flat_hash_set
@@ -3950,8 +3950,8 @@ struct HashtableDebugAccess<Set, phmap::void_t<typename Set::raw_hash_set>>
// -----------------------------------------------------------------------------
template <class T, class Hash, class Eq, class Alloc> // default values in phmap_fwd_decl.h
class flat_hash_set
: public phmap::container_internal::raw_hash_set<
phmap::container_internal::FlatHashSetPolicy<T>, Hash, Eq, Alloc>
: public phmap::priv::raw_hash_set<
phmap::priv::FlatHashSetPolicy<T>, Hash, Eq, Alloc>
{
using Base = typename flat_hash_set::raw_hash_set;
@@ -4011,8 +4011,8 @@ public:
// * Returns `void` from the `_erase(iterator)` overload.
// -----------------------------------------------------------------------------
template <class K, class V, class Hash, class Eq, class Alloc> // default values in phmap_fwd_decl.h
class flat_hash_map : public phmap::container_internal::raw_hash_map<
phmap::container_internal::FlatHashMapPolicy<K, V>,
class flat_hash_map : public phmap::priv::raw_hash_map<
phmap::priv::FlatHashMapPolicy<K, V>,
Hash, Eq, Alloc> {
using Base = typename flat_hash_map::raw_hash_map;
@@ -4074,8 +4074,8 @@ public:
// -----------------------------------------------------------------------------
template <class T, class Hash, class Eq, class Alloc> // default values in phmap_fwd_decl.h
class node_hash_set
: public phmap::container_internal::raw_hash_set<
phmap::container_internal::NodeHashSetPolicy<T>, Hash, Eq, Alloc>
: public phmap::priv::raw_hash_set<
phmap::priv::NodeHashSetPolicy<T>, Hash, Eq, Alloc>
{
using Base = typename node_hash_set::raw_hash_set;
@@ -4136,8 +4136,8 @@ public:
// -----------------------------------------------------------------------------
template <class Key, class Value, class Hash, class Eq, class Alloc> // default values in phmap_fwd_decl.h
class node_hash_map
: public phmap::container_internal::raw_hash_map<
phmap::container_internal::NodeHashMapPolicy<Key, Value>, Hash, Eq,
: public phmap::priv::raw_hash_map<
phmap::priv::NodeHashMapPolicy<Key, Value>, Hash, Eq,
Alloc>
{
using Base = typename node_hash_map::raw_hash_map;
@@ -4190,9 +4190,9 @@ public:
// -----------------------------------------------------------------------------
template <class T, class Hash, class Eq, class Alloc, size_t N, class Mtx_> // default values in phmap_fwd_decl.h
class parallel_flat_hash_set
: public phmap::container_internal::parallel_hash_set<
N, phmap::container_internal::raw_hash_set, Mtx_,
phmap::container_internal::FlatHashSetPolicy<T>,
: public phmap::priv::parallel_hash_set<
N, phmap::priv::raw_hash_set, Mtx_,
phmap::priv::FlatHashSetPolicy<T>,
Hash, Eq, Alloc>
{
using Base = typename parallel_flat_hash_set::parallel_hash_set;
@@ -4241,9 +4241,9 @@ public:
// phmap::parallel_flat_hash_map - default values in phmap_fwd_decl.h
// -----------------------------------------------------------------------------
template <class K, class V, class Hash, class Eq, class Alloc, size_t N, class Mtx_>
class parallel_flat_hash_map : public phmap::container_internal::parallel_hash_map<
N, phmap::container_internal::raw_hash_set, Mtx_,
phmap::container_internal::FlatHashMapPolicy<K, V>,
class parallel_flat_hash_map : public phmap::priv::parallel_hash_map<
N, phmap::priv::raw_hash_set, Mtx_,
phmap::priv::FlatHashMapPolicy<K, V>,
Hash, Eq, Alloc>
{
using Base = typename parallel_flat_hash_map::parallel_hash_map;
@@ -4297,9 +4297,9 @@ public:
// -----------------------------------------------------------------------------
template <class T, class Hash, class Eq, class Alloc, size_t N, class Mtx_>
class parallel_node_hash_set
: public phmap::container_internal::parallel_hash_set<
N, phmap::container_internal::raw_hash_set, Mtx_,
phmap::container_internal::NodeHashSetPolicy<T>, Hash, Eq, Alloc>
: public phmap::priv::parallel_hash_set<
N, phmap::priv::raw_hash_set, Mtx_,
phmap::priv::NodeHashSetPolicy<T>, Hash, Eq, Alloc>
{
using Base = typename parallel_node_hash_set::parallel_hash_set;
@@ -4350,9 +4350,9 @@ public:
// -----------------------------------------------------------------------------
template <class Key, class Value, class Hash, class Eq, class Alloc, size_t N, class Mtx_>
class parallel_node_hash_map
: public phmap::container_internal::parallel_hash_map<
N, phmap::container_internal::raw_hash_set, Mtx_,
phmap::container_internal::NodeHashMapPolicy<Key, Value>, Hash, Eq,
: public phmap::priv::parallel_hash_map<
N, phmap::priv::raw_hash_set, Mtx_,
phmap::priv::NodeHashMapPolicy<Key, Value>, Hash, Eq,
Alloc>
{
using Base = typename parallel_node_hash_map::parallel_hash_map;
+13 -13
View File
@@ -417,7 +417,7 @@ inline void AssertHashEnabled
// hash_policy_traits
// -----------------------------------------------------------------------------
namespace phmap {
namespace container_internal {
namespace priv {
// Defines how slots are initialized/destroyed/moved.
template <class Policy, class = void>
@@ -581,7 +581,7 @@ private:
}
};
} // namespace container_internal
} // namespace priv
} // namespace phmap
// -----------------------------------------------------------------------------
@@ -2710,7 +2710,7 @@ struct hash<phmap::optional<T> >
// common.h
// -----------------------------------------------------------------------------
namespace phmap {
namespace container_internal {
namespace priv {
template <class, class = void>
struct IsTransparent : std::false_type {};
@@ -2920,7 +2920,7 @@ struct InsertReturnType
NodeType node;
};
} // namespace container_internal
} // namespace priv
} // namespace phmap
@@ -3690,7 +3690,7 @@ constexpr Span<const T> MakeConstSpan(const T (&array)[N]) noexcept {
#endif
namespace phmap {
namespace container_internal {
namespace priv {
// A type wrapper that instructs `Layout` to use the specific alignment for the
// array. `Layout<..., Aligned<T, N>, ...>` has exactly the same API
@@ -4161,7 +4161,7 @@ public:
: internal_layout::LayoutType<sizeof...(Ts), Ts...>(sizes...) {}
};
} // namespace container_internal
} // namespace priv
} // namespace phmap
// ---------------------------------------------------------------------------
@@ -4177,7 +4177,7 @@ public:
#endif // _MSC_VER
namespace phmap {
namespace container_internal {
namespace priv {
template <typename... Ts>
class CompressedTuple;
@@ -4277,7 +4277,7 @@ struct PHMAP_INTERNAL_COMPRESSED_TUPLE_DECLSPEC
// To access the members, use member .get<N>() function.
//
// Eg:
// phmap::container_internal::CompressedTuple<int, T1, T2, T3> value(7, t1, t2,
// phmap::priv::CompressedTuple<int, T1, T2, T3> value(7, t1, t2,
// t3);
// assert(value.get<0>() == 7);
// T1& t1 = value.get<1>();
@@ -4329,12 +4329,12 @@ public:
template <>
class PHMAP_INTERNAL_COMPRESSED_TUPLE_DECLSPEC CompressedTuple<> {};
} // namespace container_internal
} // namespace priv
} // namespace phmap
namespace phmap {
namespace container_internal {
namespace priv {
#ifdef _MSC_VER
#pragma warning(push)
@@ -4420,7 +4420,7 @@ inline void SanitizerUnpoisonObject(const T* object) {
SanitizerUnpoisonMemoryRegion(object, sizeof(T));
}
} // namespace container_internal
} // namespace priv
} // namespace phmap
@@ -4534,7 +4534,7 @@ inline T& ts_unchecked_read(T& v) PHMAP_NO_THREAD_SAFETY_ANALYSIS {
} // namespace thread_safety_analysis
namespace container_internal {
namespace priv {
namespace memory_internal {
@@ -4747,7 +4747,7 @@ public:
}
};
} // namespace container_internal
} // namespace priv
} // phmap
+2 -2
View File
@@ -40,7 +40,7 @@ struct IsTriviallyCopyable<std::pair<T1, T2>> {
};
}
namespace container_internal {
namespace priv {
// ------------------------------------------------------------------------
// dump/load for raw_hash_set
@@ -166,7 +166,7 @@ bool parallel_hash_set<N, RefSet, Mtx_, Policy, Hash, Eq, Alloc>::load(InputArch
}
return true;
}
} // namespace container_internal
} // namespace priv
+34 -34
View File
@@ -40,7 +40,7 @@ namespace phmap {
class NullMutex;
namespace container_internal {
namespace priv {
// The hash of an object of type T is computed by using phmap::Hash.
template <class T, class E = void>
@@ -51,10 +51,10 @@ namespace phmap {
};
template <class T>
using hash_default_hash = typename container_internal::HashEq<T>::Hash;
using hash_default_hash = typename priv::HashEq<T>::Hash;
template <class T>
using hash_default_eq = typename container_internal::HashEq<T>::Eq;
using hash_default_eq = typename priv::HashEq<T>::Eq;
// type alias for std::allocator so we can forward declare without including other headers
template <class T>
@@ -64,65 +64,65 @@ namespace phmap {
template<class T1, class T2>
using Pair = typename phmap::Pair<T1, T2>;
} // namespace container_internal
} // namespace priv
// ------------- forward declarations for hash containers ----------------------------------
template <class T,
class Hash = phmap::container_internal::hash_default_hash<T>,
class Eq = phmap::container_internal::hash_default_eq<T>,
class Alloc = phmap::container_internal::Allocator<T>> // alias for std::allocator
class Hash = phmap::priv::hash_default_hash<T>,
class Eq = phmap::priv::hash_default_eq<T>,
class Alloc = phmap::priv::Allocator<T>> // alias for std::allocator
class flat_hash_set;
template <class K, class V,
class Hash = phmap::container_internal::hash_default_hash<K>,
class Eq = phmap::container_internal::hash_default_eq<K>,
class Alloc = phmap::container_internal::Allocator<
phmap::container_internal::Pair<const K, V>>> // alias for std::allocator
class Hash = phmap::priv::hash_default_hash<K>,
class Eq = phmap::priv::hash_default_eq<K>,
class Alloc = phmap::priv::Allocator<
phmap::priv::Pair<const K, V>>> // alias for std::allocator
class flat_hash_map;
template <class T,
class Hash = phmap::container_internal::hash_default_hash<T>,
class Eq = phmap::container_internal::hash_default_eq<T>,
class Alloc = phmap::container_internal::Allocator<T>> // alias for std::allocator
class Hash = phmap::priv::hash_default_hash<T>,
class Eq = phmap::priv::hash_default_eq<T>,
class Alloc = phmap::priv::Allocator<T>> // alias for std::allocator
class node_hash_set;
template <class Key, class Value,
class Hash = phmap::container_internal::hash_default_hash<Key>,
class Eq = phmap::container_internal::hash_default_eq<Key>,
class Alloc = phmap::container_internal::Allocator<
phmap::container_internal::Pair<const Key, Value>>> // alias for std::allocator
class Hash = phmap::priv::hash_default_hash<Key>,
class Eq = phmap::priv::hash_default_eq<Key>,
class Alloc = phmap::priv::Allocator<
phmap::priv::Pair<const Key, Value>>> // alias for std::allocator
class node_hash_map;
template <class T,
class Hash = phmap::container_internal::hash_default_hash<T>,
class Eq = phmap::container_internal::hash_default_eq<T>,
class Alloc = phmap::container_internal::Allocator<T>, // alias for std::allocator
class Hash = phmap::priv::hash_default_hash<T>,
class Eq = phmap::priv::hash_default_eq<T>,
class Alloc = phmap::priv::Allocator<T>, // alias for std::allocator
size_t N = 4, // 2**N submaps
class Mutex = phmap::NullMutex> // use std::mutex to enable internal locks
class parallel_flat_hash_set;
template <class K, class V,
class Hash = phmap::container_internal::hash_default_hash<K>,
class Eq = phmap::container_internal::hash_default_eq<K>,
class Alloc = phmap::container_internal::Allocator<
phmap::container_internal::Pair<const K, V>>, // alias for std::allocator
class Hash = phmap::priv::hash_default_hash<K>,
class Eq = phmap::priv::hash_default_eq<K>,
class Alloc = phmap::priv::Allocator<
phmap::priv::Pair<const K, V>>, // alias for std::allocator
size_t N = 4, // 2**N submaps
class Mutex = phmap::NullMutex> // use std::mutex to enable internal locks
class parallel_flat_hash_map;
template <class T,
class Hash = phmap::container_internal::hash_default_hash<T>,
class Eq = phmap::container_internal::hash_default_eq<T>,
class Alloc = phmap::container_internal::Allocator<T>, // alias for std::allocator
class Hash = phmap::priv::hash_default_hash<T>,
class Eq = phmap::priv::hash_default_eq<T>,
class Alloc = phmap::priv::Allocator<T>, // alias for std::allocator
size_t N = 4, // 2**N submaps
class Mutex = phmap::NullMutex> // use std::mutex to enable internal locks
class parallel_node_hash_set;
template <class Key, class Value,
class Hash = phmap::container_internal::hash_default_hash<Key>,
class Eq = phmap::container_internal::hash_default_eq<Key>,
class Alloc = phmap::container_internal::Allocator<
phmap::container_internal::Pair<const Key, Value>>, // alias for std::allocator
class Hash = phmap::priv::hash_default_hash<Key>,
class Eq = phmap::priv::hash_default_eq<Key>,
class Alloc = phmap::priv::Allocator<
phmap::priv::Pair<const Key, Value>>, // alias for std::allocator
size_t N = 4, // 2**N submaps
class Mutex = phmap::NullMutex> // use std::mutex to enable internal locks
class parallel_node_hash_map;
@@ -137,11 +137,11 @@ namespace phmap {
class btree_multiset;
template <typename Key, typename Value, typename Compare = phmap::Less<Key>,
typename Alloc = phmap::Allocator<phmap::container_internal::Pair<const Key, Value>>>
typename Alloc = phmap::Allocator<phmap::priv::Pair<const Key, Value>>>
class btree_map;
template <typename Key, typename Value, typename Compare = phmap::Less<Key>,
typename Alloc = phmap::Allocator<phmap::container_internal::Pair<const Key, Value>>>
typename Alloc = phmap::Allocator<phmap::priv::Pair<const Key, Value>>>
class btree_multimap;
} // namespace phmap
+4 -4
View File
@@ -49,19 +49,19 @@
</Expand>
</Type>
<Type Name="phmap::container_internal::map_slot_type&lt;*,*&gt;">
<Type Name="phmap::priv::map_slot_type&lt;*,*&gt;">
<DisplayString>{value}</DisplayString>
</Type>
<!-- flat map iterators -->
<Type Name="phmap::container_internal::raw_hash_set&lt;*,*,*,*&gt;::iterator">
<Type Name="phmap::priv::raw_hash_set&lt;*,*,*,*&gt;::iterator">
<DisplayString Condition="ctrl_ == 0">unset</DisplayString>
<DisplayString Condition="!(*ctrl_ >= 0)">end()</DisplayString>
<DisplayString>{*slot_,na}</DisplayString>
</Type>
<!-- node map iterators - only difference is the **slot_ instead of * -->
<Type Name="phmap::container_internal::raw_hash_set&lt;phmap::container_internal::NodeHashSetPolicy&lt;*&gt;,*,*,*&gt;::iterator">
<Type Name="phmap::priv::raw_hash_set&lt;phmap::priv::NodeHashSetPolicy&lt;*&gt;,*,*,*&gt;::iterator">
<DisplayString Condition="ctrl_ == 0">unset</DisplayString>
<DisplayString Condition="!(*ctrl_ >= 0)">end()</DisplayString>
<DisplayString>{**slot_,na}</DisplayString>
@@ -133,7 +133,7 @@
</Expand>
</Type>
<Type Name="phmap::container_internal::parallel_hash_set&lt;*,*,*,*,*,*,*&gt;::iterator">
<Type Name="phmap::priv::parallel_hash_set&lt;*,*,*,*,*,*,*&gt;::iterator">
<DisplayString>{it_,na}</DisplayString>
</Type>
-488
View File
@@ -1,488 +0,0 @@
// Copyright 2018 The Abseil Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef PHMAP_CONTAINER_INTERNAL_UNORDERED_MAP_CONSTRUCTOR_TEST_H_
#define PHMAP_CONTAINER_INTERNAL_UNORDERED_MAP_CONSTRUCTOR_TEST_H_
#include <algorithm>
#include <vector>
#include <unordered_map>
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "hash_generator_testing.h"
#include "hash_policy_testing.h"
namespace phmap {
namespace container_internal {
template <class UnordMap>
class ConstructorTest : public ::testing::Test {};
TYPED_TEST_SUITE_P(ConstructorTest);
TYPED_TEST_P(ConstructorTest, NoArgs) {
TypeParam m;
EXPECT_TRUE(m.empty());
EXPECT_THAT(m, ::testing::UnorderedElementsAre());
}
TYPED_TEST_P(ConstructorTest, BucketCount) {
TypeParam m(123);
EXPECT_TRUE(m.empty());
EXPECT_THAT(m, ::testing::UnorderedElementsAre());
EXPECT_GE(m.bucket_count(), 123);
}
TYPED_TEST_P(ConstructorTest, BucketCountHash) {
using H = typename TypeParam::hasher;
H hasher;
TypeParam m(123, hasher);
EXPECT_EQ(m.hash_function(), hasher);
EXPECT_TRUE(m.empty());
EXPECT_THAT(m, ::testing::UnorderedElementsAre());
EXPECT_GE(m.bucket_count(), 123);
}
TYPED_TEST_P(ConstructorTest, BucketCountHashEqual) {
using H = typename TypeParam::hasher;
using E = typename TypeParam::key_equal;
H hasher;
E equal;
TypeParam m(123, hasher, equal);
EXPECT_EQ(m.hash_function(), hasher);
EXPECT_EQ(m.key_eq(), equal);
EXPECT_TRUE(m.empty());
EXPECT_THAT(m, ::testing::UnorderedElementsAre());
EXPECT_GE(m.bucket_count(), 123);
}
TYPED_TEST_P(ConstructorTest, BucketCountHashEqualAlloc) {
using H = typename TypeParam::hasher;
using E = typename TypeParam::key_equal;
using A = typename TypeParam::allocator_type;
H hasher;
E equal;
A alloc(0);
TypeParam m(123, hasher, equal, alloc);
EXPECT_EQ(m.hash_function(), hasher);
EXPECT_EQ(m.key_eq(), equal);
EXPECT_EQ(m.get_allocator(), alloc);
EXPECT_TRUE(m.empty());
EXPECT_THAT(m, ::testing::UnorderedElementsAre());
EXPECT_GE(m.bucket_count(), 123);
}
template <typename T>
struct is_std_unordered_map : std::false_type {};
template <typename... T>
struct is_std_unordered_map<std::unordered_map<T...>> : std::true_type {};
#if defined(UNORDERED_MAP_CXX14) || defined(UNORDERED_MAP_CXX17)
using has_cxx14_std_apis = std::true_type;
#else
using has_cxx14_std_apis = std::false_type;
#endif
template <typename T>
using expect_cxx14_apis =
phmap::disjunction<phmap::negation<is_std_unordered_map<T>>,
has_cxx14_std_apis>;
template <typename TypeParam>
void BucketCountAllocTest(std::false_type) {}
template <typename TypeParam>
void BucketCountAllocTest(std::true_type) {
using A = typename TypeParam::allocator_type;
A alloc(0);
TypeParam m(123, alloc);
EXPECT_EQ(m.get_allocator(), alloc);
EXPECT_TRUE(m.empty());
EXPECT_THAT(m, ::testing::UnorderedElementsAre());
EXPECT_GE(m.bucket_count(), 123);
}
TYPED_TEST_P(ConstructorTest, BucketCountAlloc) {
BucketCountAllocTest<TypeParam>(expect_cxx14_apis<TypeParam>());
}
template <typename TypeParam>
void BucketCountHashAllocTest(std::false_type) {}
template <typename TypeParam>
void BucketCountHashAllocTest(std::true_type) {
using H = typename TypeParam::hasher;
using A = typename TypeParam::allocator_type;
H hasher;
A alloc(0);
TypeParam m(123, hasher, alloc);
EXPECT_EQ(m.hash_function(), hasher);
EXPECT_EQ(m.get_allocator(), alloc);
EXPECT_TRUE(m.empty());
EXPECT_THAT(m, ::testing::UnorderedElementsAre());
EXPECT_GE(m.bucket_count(), 123);
}
TYPED_TEST_P(ConstructorTest, BucketCountHashAlloc) {
BucketCountHashAllocTest<TypeParam>(expect_cxx14_apis<TypeParam>());
}
#if PHMAP_UNORDERED_SUPPORTS_ALLOC_CTORS
using has_alloc_std_constructors = std::true_type;
#else
using has_alloc_std_constructors = std::false_type;
#endif
template <typename T>
using expect_alloc_constructors =
phmap::disjunction<phmap::negation<is_std_unordered_map<T>>,
has_alloc_std_constructors>;
template <typename TypeParam>
void AllocTest(std::false_type) {}
template <typename TypeParam>
void AllocTest(std::true_type) {
using A = typename TypeParam::allocator_type;
A alloc(0);
TypeParam m(alloc);
EXPECT_EQ(m.get_allocator(), alloc);
EXPECT_TRUE(m.empty());
EXPECT_THAT(m, ::testing::UnorderedElementsAre());
}
TYPED_TEST_P(ConstructorTest, Alloc) {
AllocTest<TypeParam>(expect_alloc_constructors<TypeParam>());
}
TYPED_TEST_P(ConstructorTest, InputIteratorBucketHashEqualAlloc) {
using T = hash_internal::GeneratedType<TypeParam>;
using H = typename TypeParam::hasher;
using E = typename TypeParam::key_equal;
using A = typename TypeParam::allocator_type;
H hasher;
E equal;
A alloc(0);
std::vector<T> values;
std::generate_n(std::back_inserter(values), 10,
hash_internal::Generator<T>());
TypeParam m(values.begin(), values.end(), 123, hasher, equal, alloc);
EXPECT_EQ(m.hash_function(), hasher);
EXPECT_EQ(m.key_eq(), equal);
EXPECT_EQ(m.get_allocator(), alloc);
EXPECT_THAT(items(m), ::testing::UnorderedElementsAreArray(values));
EXPECT_GE(m.bucket_count(), 123);
}
template <typename TypeParam>
void InputIteratorBucketAllocTest(std::false_type) {}
template <typename TypeParam>
void InputIteratorBucketAllocTest(std::true_type) {
using T = hash_internal::GeneratedType<TypeParam>;
using A = typename TypeParam::allocator_type;
A alloc(0);
std::vector<T> values;
std::generate_n(std::back_inserter(values), 10,
hash_internal::Generator<T>());
TypeParam m(values.begin(), values.end(), 123, alloc);
EXPECT_EQ(m.get_allocator(), alloc);
EXPECT_THAT(items(m), ::testing::UnorderedElementsAreArray(values));
EXPECT_GE(m.bucket_count(), 123);
}
TYPED_TEST_P(ConstructorTest, InputIteratorBucketAlloc) {
InputIteratorBucketAllocTest<TypeParam>(expect_cxx14_apis<TypeParam>());
}
template <typename TypeParam>
void InputIteratorBucketHashAllocTest(std::false_type) {}
template <typename TypeParam>
void InputIteratorBucketHashAllocTest(std::true_type) {
using T = hash_internal::GeneratedType<TypeParam>;
using H = typename TypeParam::hasher;
using A = typename TypeParam::allocator_type;
H hasher;
A alloc(0);
std::vector<T> values;
std::generate_n(std::back_inserter(values), 10,
hash_internal::Generator<T>());
TypeParam m(values.begin(), values.end(), 123, hasher, alloc);
EXPECT_EQ(m.hash_function(), hasher);
EXPECT_EQ(m.get_allocator(), alloc);
EXPECT_THAT(items(m), ::testing::UnorderedElementsAreArray(values));
EXPECT_GE(m.bucket_count(), 123);
}
TYPED_TEST_P(ConstructorTest, InputIteratorBucketHashAlloc) {
InputIteratorBucketHashAllocTest<TypeParam>(expect_cxx14_apis<TypeParam>());
}
TYPED_TEST_P(ConstructorTest, CopyConstructor) {
using T = hash_internal::GeneratedType<TypeParam>;
using H = typename TypeParam::hasher;
using E = typename TypeParam::key_equal;
using A = typename TypeParam::allocator_type;
H hasher;
E equal;
A alloc(0);
TypeParam m(123, hasher, equal, alloc);
for (size_t i = 0; i != 10; ++i) m.insert(hash_internal::Generator<T>()());
TypeParam n(m);
EXPECT_EQ(m.hash_function(), n.hash_function());
EXPECT_EQ(m.key_eq(), n.key_eq());
EXPECT_EQ(m.get_allocator(), n.get_allocator());
EXPECT_EQ(m, n);
}
template <typename TypeParam>
void CopyConstructorAllocTest(std::false_type) {}
template <typename TypeParam>
void CopyConstructorAllocTest(std::true_type) {
using T = hash_internal::GeneratedType<TypeParam>;
using H = typename TypeParam::hasher;
using E = typename TypeParam::key_equal;
using A = typename TypeParam::allocator_type;
H hasher;
E equal;
A alloc(0);
TypeParam m(123, hasher, equal, alloc);
for (size_t i = 0; i != 10; ++i) m.insert(hash_internal::Generator<T>()());
TypeParam n(m, A(11));
EXPECT_EQ(m.hash_function(), n.hash_function());
EXPECT_EQ(m.key_eq(), n.key_eq());
EXPECT_NE(m.get_allocator(), n.get_allocator());
EXPECT_EQ(m, n);
}
TYPED_TEST_P(ConstructorTest, CopyConstructorAlloc) {
CopyConstructorAllocTest<TypeParam>(expect_alloc_constructors<TypeParam>());
}
// TODO(alkis): Test non-propagating allocators on copy constructors.
TYPED_TEST_P(ConstructorTest, MoveConstructor) {
using T = hash_internal::GeneratedType<TypeParam>;
using H = typename TypeParam::hasher;
using E = typename TypeParam::key_equal;
using A = typename TypeParam::allocator_type;
H hasher;
E equal;
A alloc(0);
TypeParam m(123, hasher, equal, alloc);
for (size_t i = 0; i != 10; ++i) m.insert(hash_internal::Generator<T>()());
TypeParam t(m);
TypeParam n(std::move(t));
EXPECT_EQ(m.hash_function(), n.hash_function());
EXPECT_EQ(m.key_eq(), n.key_eq());
EXPECT_EQ(m.get_allocator(), n.get_allocator());
EXPECT_EQ(m, n);
}
template <typename TypeParam>
void MoveConstructorAllocTest(std::false_type) {}
template <typename TypeParam>
void MoveConstructorAllocTest(std::true_type) {
using T = hash_internal::GeneratedType<TypeParam>;
using H = typename TypeParam::hasher;
using E = typename TypeParam::key_equal;
using A = typename TypeParam::allocator_type;
H hasher;
E equal;
A alloc(0);
TypeParam m(123, hasher, equal, alloc);
for (size_t i = 0; i != 10; ++i) m.insert(hash_internal::Generator<T>()());
TypeParam t(m);
TypeParam n(std::move(t), A(1));
EXPECT_EQ(m.hash_function(), n.hash_function());
EXPECT_EQ(m.key_eq(), n.key_eq());
EXPECT_NE(m.get_allocator(), n.get_allocator());
EXPECT_EQ(m, n);
}
TYPED_TEST_P(ConstructorTest, MoveConstructorAlloc) {
MoveConstructorAllocTest<TypeParam>(expect_alloc_constructors<TypeParam>());
}
// TODO(alkis): Test non-propagating allocators on move constructors.
TYPED_TEST_P(ConstructorTest, InitializerListBucketHashEqualAlloc) {
using T = hash_internal::GeneratedType<TypeParam>;
hash_internal::Generator<T> gen;
std::initializer_list<T> values = {gen(), gen(), gen(), gen(), gen()};
using H = typename TypeParam::hasher;
using E = typename TypeParam::key_equal;
using A = typename TypeParam::allocator_type;
H hasher;
E equal;
A alloc(0);
TypeParam m(values, 123, hasher, equal, alloc);
EXPECT_EQ(m.hash_function(), hasher);
EXPECT_EQ(m.key_eq(), equal);
EXPECT_EQ(m.get_allocator(), alloc);
EXPECT_THAT(items(m), ::testing::UnorderedElementsAreArray(values));
EXPECT_GE(m.bucket_count(), 123);
}
template <typename TypeParam>
void InitializerListBucketAllocTest(std::false_type) {}
template <typename TypeParam>
void InitializerListBucketAllocTest(std::true_type) {
using T = hash_internal::GeneratedType<TypeParam>;
using A = typename TypeParam::allocator_type;
hash_internal::Generator<T> gen;
std::initializer_list<T> values = {gen(), gen(), gen(), gen(), gen()};
A alloc(0);
TypeParam m(values, 123, alloc);
EXPECT_EQ(m.get_allocator(), alloc);
EXPECT_THAT(items(m), ::testing::UnorderedElementsAreArray(values));
EXPECT_GE(m.bucket_count(), 123);
}
TYPED_TEST_P(ConstructorTest, InitializerListBucketAlloc) {
InitializerListBucketAllocTest<TypeParam>(expect_cxx14_apis<TypeParam>());
}
template <typename TypeParam>
void InitializerListBucketHashAllocTest(std::false_type) {}
template <typename TypeParam>
void InitializerListBucketHashAllocTest(std::true_type) {
using T = hash_internal::GeneratedType<TypeParam>;
using H = typename TypeParam::hasher;
using A = typename TypeParam::allocator_type;
H hasher;
A alloc(0);
hash_internal::Generator<T> gen;
std::initializer_list<T> values = {gen(), gen(), gen(), gen(), gen()};
TypeParam m(values, 123, hasher, alloc);
EXPECT_EQ(m.hash_function(), hasher);
EXPECT_EQ(m.get_allocator(), alloc);
EXPECT_THAT(items(m), ::testing::UnorderedElementsAreArray(values));
EXPECT_GE(m.bucket_count(), 123);
}
TYPED_TEST_P(ConstructorTest, InitializerListBucketHashAlloc) {
InitializerListBucketHashAllocTest<TypeParam>(expect_cxx14_apis<TypeParam>());
}
TYPED_TEST_P(ConstructorTest, Assignment) {
using T = hash_internal::GeneratedType<TypeParam>;
using H = typename TypeParam::hasher;
using E = typename TypeParam::key_equal;
using A = typename TypeParam::allocator_type;
H hasher;
E equal;
A alloc(0);
hash_internal::Generator<T> gen;
TypeParam m({gen(), gen(), gen()}, 123, hasher, equal, alloc);
TypeParam n;
n = m;
EXPECT_EQ(m.hash_function(), n.hash_function());
EXPECT_EQ(m.key_eq(), n.key_eq());
EXPECT_EQ(m, n);
}
// TODO(alkis): Test [non-]propagating allocators on move/copy assignments
// (it depends on traits).
TYPED_TEST_P(ConstructorTest, MoveAssignment) {
using T = hash_internal::GeneratedType<TypeParam>;
using H = typename TypeParam::hasher;
using E = typename TypeParam::key_equal;
using A = typename TypeParam::allocator_type;
H hasher;
E equal;
A alloc(0);
hash_internal::Generator<T> gen;
TypeParam m({gen(), gen(), gen()}, 123, hasher, equal, alloc);
TypeParam t(m);
TypeParam n;
n = std::move(t);
EXPECT_EQ(m.hash_function(), n.hash_function());
EXPECT_EQ(m.key_eq(), n.key_eq());
EXPECT_EQ(m, n);
}
TYPED_TEST_P(ConstructorTest, AssignmentFromInitializerList) {
using T = hash_internal::GeneratedType<TypeParam>;
hash_internal::Generator<T> gen;
std::initializer_list<T> values = {gen(), gen(), gen(), gen(), gen()};
TypeParam m;
m = values;
EXPECT_THAT(items(m), ::testing::UnorderedElementsAreArray(values));
}
TYPED_TEST_P(ConstructorTest, AssignmentOverwritesExisting) {
using T = hash_internal::GeneratedType<TypeParam>;
hash_internal::Generator<T> gen;
TypeParam m({gen(), gen(), gen()});
TypeParam n({gen()});
n = m;
EXPECT_EQ(m, n);
}
TYPED_TEST_P(ConstructorTest, MoveAssignmentOverwritesExisting) {
using T = hash_internal::GeneratedType<TypeParam>;
hash_internal::Generator<T> gen;
TypeParam m({gen(), gen(), gen()});
TypeParam t(m);
TypeParam n({gen()});
n = std::move(t);
EXPECT_EQ(m, n);
}
TYPED_TEST_P(ConstructorTest, AssignmentFromInitializerListOverwritesExisting) {
using T = hash_internal::GeneratedType<TypeParam>;
hash_internal::Generator<T> gen;
std::initializer_list<T> values = {gen(), gen(), gen(), gen(), gen()};
TypeParam m;
m = values;
EXPECT_THAT(items(m), ::testing::UnorderedElementsAreArray(values));
}
TYPED_TEST_P(CounonstructorTest, AssignmentOnSelf) {
using T = hash_internal::GeneratedType<TypeParam>;
hash_internal::Generator<T> gen;
std::initializer_list<T> values = {gen(), gen(), gen(), gen(), gen()};
TypeParam m(values);
m = *&m; // Avoid -Wself-assign
EXPECT_THAT(items(m), ::testing::UnorderedElementsAreArray(values));
}
// We cannot test self move as standard states that it leaves standard
// containers in unspecified state (and in practice in causes memory-leak
// according to heap-checker!).
REGISTER_TYPED_TEST_SUITE_P(
ConstructorTest, NoArgs, BucketCount, BucketCountHash, BucketCountHashEqual,
BucketCountHashEqualAlloc, BucketCountAlloc, BucketCountHashAlloc, Alloc,
InputIteratorBucketHashEqualAlloc, InputIteratorBucketAlloc,
InputIteratorBucketHashAlloc, CopyConstructor, CopyConstructorAlloc,
MoveConstructor, MoveConstructorAlloc, InitializerListBucketHashEqualAlloc,
InitializerListBucketAlloc, InitializerListBucketHashAlloc, Assignment,
MoveAssignment, AssignmentFromInitializerList, AssignmentOverwritesExisting,
MoveAssignmentOverwritesExisting,
AssignmentFromInitializerListOverwritesExisting, AssignmentOnSelf);
} // namespace container_internal
} // namespace phmap
#endif // PHMAP_CONTAINER_INTERNAL_UNORDERED_MAP_CONSTRUCTOR_TEST_H_
+2 -2
View File
@@ -50,7 +50,7 @@ namespace phmap {
static const size_t test_values = 10000;
namespace phmap {
namespace container_internal {
namespace priv {
namespace {
using ::phmap::test_internal::CopyableMovableInstance;
@@ -2368,5 +2368,5 @@ namespace {
}
} // namespace
} // namespace container_internal
} // namespace priv
} // namespace phmap
+4 -4
View File
@@ -306,7 +306,7 @@ namespace test_internal {
} // namespace test_internal
namespace container_internal {
namespace priv {
// Like remove_const but propagates the removal through std::pair.
template <typename T>
@@ -427,9 +427,9 @@ namespace container_internal {
return vec;
}
} // namespace container_internal
} // namespace priv
namespace container_internal {
namespace priv {
// This is a stateful allocator, but the state lives outside of the
// allocator (in whatever test is using the allocator). This is odd
@@ -483,7 +483,7 @@ namespace container_internal {
int64_t* bytes_used_;
};
} // namespace container_internal
} // namespace priv
} // namespace phmap
+2 -2
View File
@@ -21,7 +21,7 @@
#include "gtest/gtest.h"
namespace phmap {
namespace container_internal {
namespace priv {
namespace {
enum class CallType { kConstRef, kConstMove };
@@ -197,5 +197,5 @@ TEST(CompressedTupleTest, EmptyFinalClass) {
#endif
} // namespace
} // namespace container_internal
} // namespace priv
} // namespace phmap
+2 -2
View File
@@ -26,7 +26,7 @@
#include "gtest/gtest.h"
namespace phmap {
namespace container_internal {
namespace priv {
namespace {
using ::testing::Pair;
@@ -189,5 +189,5 @@ TEST(DecomposePair, NotDecomposable) {
}
} // namespace
} // namespace container_internal
} // namespace priv
} // namespace phmap
+1 -1
View File
@@ -5,7 +5,7 @@
#include "parallel_hashmap/phmap_dump.h"
namespace phmap {
namespace container_internal {
namespace priv {
namespace {
TEST(DumpLoad, FlatHashSet_uin32) {
+8 -8
View File
@@ -44,10 +44,10 @@
#endif
namespace phmap {
namespace container_internal {
namespace priv {
namespace {
using ::phmap::container_internal::hash_internal::Enum;
using ::phmap::container_internal::hash_internal::EnumClass;
using ::phmap::priv::hash_internal::Enum;
using ::phmap::priv::hash_internal::EnumClass;
using ::testing::_;
using ::testing::Pair;
using ::testing::UnorderedElementsAre;
@@ -57,10 +57,10 @@ using Map = THIS_HASH_MAP<K, V, StatefulTestingHash, StatefulTestingEqual,
Alloc<std::pair<const K, V>> THIS_EXTRA_TPL_PARAMS>;
template <class K, class V, class H = phmap::container_internal::hash_default_hash<K>,
class Eq = phmap::container_internal::hash_default_eq<K>,
class Alloc = phmap::container_internal::Allocator<
phmap::container_internal::Pair<const K, V>>>
template <class K, class V, class H = phmap::priv::hash_default_hash<K>,
class Eq = phmap::priv::hash_default_eq<K>,
class Alloc = phmap::priv::Allocator<
phmap::priv::Pair<const K, V>>>
using ThisMap = THIS_HASH_MAP<K, V, H, Eq, Alloc THIS_EXTRA_TPL_PARAMS>;
static_assert(!std::is_standard_layout<NonStandardLayout>(), "");
@@ -282,5 +282,5 @@ TEST(THIS_TEST_NAME, Any) {
#endif // __ANDROID__
} // namespace
} // namespace container_internal
} // namespace priv
} // namespace phmap
+4 -4
View File
@@ -28,11 +28,11 @@
#include "unordered_set_modifiers_test.h"
namespace phmap {
namespace container_internal {
namespace priv {
namespace {
using ::phmap::container_internal::hash_internal::Enum;
using ::phmap::container_internal::hash_internal::EnumClass;
using ::phmap::priv::hash_internal::Enum;
using ::phmap::priv::hash_internal::EnumClass;
using ::testing::Pointee;
using ::testing::UnorderedElementsAre;
using ::testing::UnorderedElementsAreArray;
@@ -129,5 +129,5 @@ TEST(THIS_TEST_NAME, MergeExtractInsert) {
}
} // namespace
} // namespace container_internal
} // namespace priv
} // namespace phmap
+7 -7
View File
@@ -15,8 +15,8 @@
// Generates random values for testing. Specialized only for the few types we
// care about.
#ifndef PHMAP_CONTAINER_INTERNAL_HASH_GENERATOR_TESTING_H_
#define PHMAP_CONTAINER_INTERNAL_HASH_GENERATOR_TESTING_H_
#ifndef PHMAP_PRIV_HASH_GENERATOR_TESTING_H_
#define PHMAP_PRIV_HASH_GENERATOR_TESTING_H_
#include <stdint.h>
#include <algorithm>
@@ -36,7 +36,7 @@
#include "hash_policy_testing.h"
namespace phmap {
namespace container_internal {
namespace priv {
namespace hash_internal {
namespace generator_internal {
@@ -194,13 +194,13 @@ using GeneratedType = decltype(
typename Container::key_type>::type>&>()());
} // namespace hash_internal
} // namespace container_internal
} // namespace priv
} // namespace phmap
namespace std
{
using phmap::container_internal::hash_internal::EnumClass;
using phmap::container_internal::hash_internal::Enum;
using phmap::priv::hash_internal::EnumClass;
using phmap::priv::hash_internal::Enum;
template<>
struct hash<EnumClass>
@@ -215,4 +215,4 @@ namespace std
}
#endif // PHMAP_CONTAINER_INTERNAL_HASH_GENERATOR_TESTING_H_
#endif // PHMAP_PRIV_HASH_GENERATOR_TESTING_H_
+9 -9
View File
@@ -15,8 +15,8 @@
// Utilities to help tests verify that hash tables properly handle stateful
// allocators and hash functions.
#ifndef PHMAP_CONTAINER_INTERNAL_HASH_POLICY_TESTING_H_
#define PHMAP_CONTAINER_INTERNAL_HASH_POLICY_TESTING_H_
#ifndef PHMAP_PRIV_HASH_POLICY_TESTING_H_
#define PHMAP_PRIV_HASH_POLICY_TESTING_H_
#include <cstdlib>
#include <limits>
@@ -27,7 +27,7 @@
#include <vector>
namespace phmap {
namespace container_internal {
namespace priv {
namespace hash_testing_internal {
template <class Derived>
@@ -92,7 +92,7 @@ struct NonStandardLayout
};
struct StatefulTestingHash
: phmap::container_internal::hash_testing_internal::WithId<
: phmap::priv::hash_testing_internal::WithId<
StatefulTestingHash>
{
template <class T>
@@ -102,7 +102,7 @@ struct StatefulTestingHash
};
struct StatefulTestingEqual
: phmap::container_internal::hash_testing_internal::WithId<
: phmap::priv::hash_testing_internal::WithId<
StatefulTestingEqual> {
template <class T, class U>
bool operator()(const T& t, const U& u) const {
@@ -160,7 +160,7 @@ auto keys(const Set& s)
return res;
}
} // namespace container_internal
} // namespace priv
} // namespace phmap
namespace std
@@ -168,9 +168,9 @@ namespace std
// inject specialization of std::hash for NonStandardLayout into namespace std
// ----------------------------------------------------------------
template<>
struct hash<phmap::container_internal::NonStandardLayout>
struct hash<phmap::priv::NonStandardLayout>
{
std::size_t operator()(phmap::container_internal::NonStandardLayout const &p) const
std::size_t operator()(phmap::priv::NonStandardLayout const &p) const
{
return std::hash<std::string>()(p.value);
}
@@ -192,4 +192,4 @@ namespace std
#define PHMAP_UNORDERED_SUPPORTS_ALLOC_CTORS 1
#endif
#endif // PHMAP_CONTAINER_INTERNAL_HASH_POLICY_TESTING_H_
#endif // PHMAP_PRIV_HASH_POLICY_TESTING_H_
+2 -2
View File
@@ -18,7 +18,7 @@
#include "gtest/gtest.h"
namespace phmap {
namespace container_internal {
namespace priv {
namespace {
TEST(_, Hash) {
@@ -40,5 +40,5 @@ TEST(_, Hash) {
}
} // namespace
} // namespace container_internal
} // namespace priv
} // namespace phmap
+9 -9
View File
@@ -27,8 +27,8 @@
// This library supports std::unordered_{set,map}, dense_hash_{set,map} and
// phmap::{flat,node,string}_hash_{set,map}.
#ifndef PHMAP_CONTAINER_INTERNAL_HASHTABLE_DEBUG_H_
#define PHMAP_CONTAINER_INTERNAL_HASHTABLE_DEBUG_H_
#ifndef PHMAP_PRIV_HASHTABLE_DEBUG_H_
#define PHMAP_PRIV_HASHTABLE_DEBUG_H_
#include <cstddef>
#include <algorithm>
@@ -36,7 +36,7 @@
#include <vector>
namespace phmap {
namespace container_internal {
namespace priv {
// Returns the number of probes required to lookup `key`. Returns 0 for a
// search with no collisions. Higher values mean more hash collisions occurred;
@@ -45,7 +45,7 @@ namespace container_internal {
template <typename C>
size_t GetHashtableDebugNumProbes(
const C& c, const typename C::key_type& key) {
return phmap::container_internal::hashtable_debug_internal::
return phmap::priv::hashtable_debug_internal::
HashtableDebugAccess<C>::GetNumProbes(c, key);
}
@@ -57,7 +57,7 @@ std::vector<size_t> GetHashtableDebugNumProbesHistogram(const C& container) {
for (auto it = container.begin(); it != container.end(); ++it) {
size_t num_probes = GetHashtableDebugNumProbes(
container,
phmap::container_internal::hashtable_debug_internal::GetKey<C>(*it, 0));
phmap::priv::hashtable_debug_internal::GetKey<C>(*it, 0));
v.resize((std::max)(v.size(), num_probes + 1));
v[num_probes]++;
}
@@ -88,7 +88,7 @@ HashtableDebugProbeSummary GetHashtableDebugProbeSummary(const C& container) {
// and not freed.
template <typename C>
size_t AllocatedByteSize(const C& c) {
return phmap::container_internal::hashtable_debug_internal::
return phmap::priv::hashtable_debug_internal::
HashtableDebugAccess<C>::AllocatedByteSize(c);
}
@@ -96,11 +96,11 @@ size_t AllocatedByteSize(const C& c) {
// and `c.size()` is equal to `num_elements`.
template <typename C>
size_t LowerBoundAllocatedByteSize(size_t num_elements) {
return phmap::container_internal::hashtable_debug_internal::
return phmap::priv::hashtable_debug_internal::
HashtableDebugAccess<C>::LowerBoundAllocatedByteSize(num_elements);
}
} // namespace container_internal
} // namespace priv
} // namespace phmap
#endif // PHMAP_CONTAINER_INTERNAL_HASHTABLE_DEBUG_H_
#endif // PHMAP_PRIV_HASHTABLE_DEBUG_H_
+2 -2
View File
@@ -26,7 +26,7 @@
#include "unordered_map_modifiers_test.h"
namespace phmap {
namespace container_internal {
namespace priv {
namespace {
using ::testing::Field;
@@ -221,5 +221,5 @@ TEST(THIS_TEST_NAME, MergeExtractInsert) {
}
} // namespace
} // namespace container_internal
} // namespace priv
} // namespace phmap
+2 -2
View File
@@ -19,7 +19,7 @@
#include "gtest/gtest.h"
namespace phmap {
namespace container_internal {
namespace priv {
namespace {
using ::testing::Pointee;
@@ -61,5 +61,5 @@ TEST_F(NodeTest, transfer) {
}
} // namespace
} // namespace container_internal
} // namespace priv
} // namespace phmap
+4 -4
View File
@@ -25,10 +25,10 @@
#include "unordered_set_modifiers_test.h"
namespace phmap {
namespace container_internal {
namespace priv {
namespace {
using ::phmap::container_internal::hash_internal::Enum;
using ::phmap::container_internal::hash_internal::EnumClass;
using ::phmap::priv::hash_internal::Enum;
using ::phmap::priv::hash_internal::EnumClass;
using ::testing::Pointee;
using ::testing::UnorderedElementsAre;
@@ -106,5 +106,5 @@ TEST(THIS_TEST_NAME, MergeExtractInsert) {
}
} // namespace
} // namespace container_internal
} // namespace priv
} // namespace phmap
+2 -2
View File
@@ -6,7 +6,7 @@
#include "flat_hash_map_test.cc"
namespace phmap {
namespace container_internal {
namespace priv {
namespace {
TEST(THIS_TEST_NAME, ThreadSafeContains) {
@@ -23,5 +23,5 @@ TEST(THIS_TEST_NAME, ThreadSafeContains) {
}
} // namespace
} // namespace container_internal
} // namespace priv
} // namespace phmap
+2 -2
View File
@@ -20,7 +20,7 @@
#include "tracked.h"
namespace phmap {
namespace container_internal {
namespace priv {
namespace {
enum AllocSpec {
@@ -424,5 +424,5 @@ TEST_F(PropagateOnAll, Swap) {
}
} // namespace
} // namespace container_internal
} // namespace priv
} // namespace phmap
+15 -15
View File
@@ -42,7 +42,7 @@
#include "gtest/gtest.h"
namespace phmap {
namespace container_internal {
namespace priv {
struct RawHashSetTestOnlyAccess {
template <typename C>
@@ -212,7 +212,7 @@ TEST(Group, MatchEmptyOrDeleted) {
TEST(Batch, DropDeletes) {
constexpr size_t kCapacity = 63;
constexpr size_t kGroupWidth = container_internal::Group::kWidth;
constexpr size_t kGroupWidth = priv::Group::kWidth;
std::vector<ctrl_t> ctrl(kCapacity + 1 + kGroupWidth);
ctrl[kCapacity] = kSentinel;
std::vector<ctrl_t> pattern = {kEmpty, 2, kDeleted, 2, kEmpty, 1, kDeleted};
@@ -349,7 +349,7 @@ struct StringTable
#endif
struct IntTable
: raw_hash_set<IntPolicy, container_internal::hash_default_hash<int64_t>,
: raw_hash_set<IntPolicy, priv::hash_default_hash<int64_t>,
std::equal_to<int64_t>, std::allocator<int64_t>> {
using Base = typename IntTable::raw_hash_set;
IntTable() {}
@@ -369,7 +369,7 @@ struct CustomAlloc : std::allocator<T> {
};
struct CustomAllocIntTable
: raw_hash_set<IntPolicy, container_internal::hash_default_hash<int64_t>,
: raw_hash_set<IntPolicy, priv::hash_default_hash<int64_t>,
std::equal_to<int64_t>, CustomAlloc<int64_t>> {
using Base = typename CustomAllocIntTable::raw_hash_set;
using Base::Base;
@@ -850,7 +850,7 @@ TEST(Table, EnsureNonQuadraticAsInRust) {
TEST(Table, ClearBug) {
IntTable t;
constexpr size_t capacity = container_internal::Group::kWidth - 1;
constexpr size_t capacity = priv::Group::kWidth - 1;
constexpr size_t max_size = capacity / 2 + 1;
for (size_t i = 0; i < max_size; ++i) {
t.insert(i);
@@ -1112,7 +1112,7 @@ ExpectedStats XorSeedExpectedStats() {
// The effective load factor is larger in non-opt mode because we insert
// elements out of order.
PHMAP_IF_CONSTEXPR (container_internal::Group::kWidth == 8) {
PHMAP_IF_CONSTEXPR (priv::Group::kWidth == 8) {
if (kRandomizesInserts) {
return {0.05,
1.0,
@@ -1216,7 +1216,7 @@ ExpectedStats LinearTransformExpectedStats() {
// The effective load factor is larger in non-opt mode because we insert
// elements out of order.
PHMAP_IF_CONSTEXPR (container_internal::Group::kWidth == 8) {
PHMAP_IF_CONSTEXPR (priv::Group::kWidth == 8) {
if (kRandomizesInserts) {
return {0.1,
0.5,
@@ -1433,7 +1433,7 @@ TEST(Table, CopyConstructWithAlloc) {
}
struct ExplicitAllocIntTable
: raw_hash_set<IntPolicy, container_internal::hash_default_hash<int64_t>,
: raw_hash_set<IntPolicy, priv::hash_default_hash<int64_t>,
std::equal_to<int64_t>, Alloc<int64_t>> {
ExplicitAllocIntTable() {}
};
@@ -1606,11 +1606,11 @@ TEST(Table, NoThrowMoveAssign) {
TEST(Table, NoThrowSwappable) {
ASSERT_TRUE(
container_internal::IsNoThrowSwappable<phmap::Hash<std::string_view>>());
ASSERT_TRUE(container_internal::IsNoThrowSwappable<
priv::IsNoThrowSwappable<phmap::Hash<std::string_view>>());
ASSERT_TRUE(priv::IsNoThrowSwappable<
std::equal_to<std::string_view>>());
ASSERT_TRUE(container_internal::IsNoThrowSwappable<std::allocator<int>>());
EXPECT_TRUE(container_internal::IsNoThrowSwappable<StringTable>());
ASSERT_TRUE(priv::IsNoThrowSwappable<std::allocator<int>>());
EXPECT_TRUE(priv::IsNoThrowSwappable<StringTable>());
}
#endif
@@ -1695,8 +1695,8 @@ TEST(Table, HeterogeneousLookupOverloads) {
using TransparentTable = raw_hash_set<
StringPolicy,
phmap::container_internal::hash_default_hash<std::string_view>,
phmap::container_internal::hash_default_eq<std::string_view>,
phmap::priv::hash_default_hash<std::string_view>,
phmap::priv::hash_default_eq<std::string_view>,
std::allocator<int>>;
EXPECT_TRUE((VerifyResultOf<CallFind, TransparentTable>()));
@@ -1958,5 +1958,5 @@ TEST(Sanitizer, PoisoningOnErase) {
#endif // ADDRESS_SANITIZER
} // namespace
} // namespace container_internal
} // namespace priv
} // namespace phmap
+5 -5
View File
@@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef PHMAP_CONTAINER_INTERNAL_TRACKED_H_
#define PHMAP_CONTAINER_INTERNAL_TRACKED_H_
#ifndef PHMAP_PRIV_TRACKED_H_
#define PHMAP_PRIV_TRACKED_H_
#include <stddef.h>
#include <memory>
#include <utility>
namespace phmap {
namespace container_internal {
namespace priv {
// A class that tracks its copies and moves so that it can be queried in tests.
template <class T>
@@ -72,7 +72,7 @@ class Tracked {
std::shared_ptr<size_t> num_copies_ = std::make_shared<size_t>(0);
};
} // namespace container_internal
} // namespace priv
} // namespace phmap
#endif // PHMAP_CONTAINER_INTERNAL_TRACKED_H_
#endif // PHMAP_PRIV_TRACKED_H_
+5 -5
View File
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef PHMAP_CONTAINER_INTERNAL_UNORDERED_MAP_CONSTRUCTOR_TEST_H_
#define PHMAP_CONTAINER_INTERNAL_UNORDERED_MAP_CONSTRUCTOR_TEST_H_
#ifndef PHMAP_PRIV_UNORDERED_MAP_CONSTRUCTOR_TEST_H_
#define PHMAP_PRIV_UNORDERED_MAP_CONSTRUCTOR_TEST_H_
#include <algorithm>
#include <vector>
@@ -33,7 +33,7 @@
#endif
namespace phmap {
namespace container_internal {
namespace priv {
template <class UnordMap>
class ConstructorTest : public ::testing::Test {};
@@ -490,7 +490,7 @@ REGISTER_TYPED_TEST_SUITE_P(
MoveAssignmentOverwritesExisting,
AssignmentFromInitializerListOverwritesExisting, AssignmentOnSelf);
} // namespace container_internal
} // namespace priv
} // namespace phmap
#endif // PHMAP_CONTAINER_INTERNAL_UNORDERED_MAP_CONSTRUCTOR_TEST_H_
#endif // PHMAP_PRIV_UNORDERED_MAP_CONSTRUCTOR_TEST_H_
+5 -5
View File
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef PHMAP_CONTAINER_INTERNAL_UNORDERED_MAP_LOOKUP_TEST_H_
#define PHMAP_CONTAINER_INTERNAL_UNORDERED_MAP_LOOKUP_TEST_H_
#ifndef PHMAP_PRIV_UNORDERED_MAP_LOOKUP_TEST_H_
#define PHMAP_PRIV_UNORDERED_MAP_LOOKUP_TEST_H_
#ifdef _MSC_VER
#pragma warning(push, 0)
@@ -29,7 +29,7 @@
#endif
namespace phmap {
namespace container_internal {
namespace priv {
template <class UnordMap>
class LookupTest : public ::testing::Test {};
@@ -117,7 +117,7 @@ TYPED_TEST_P(LookupTest, EqualRange) {
REGISTER_TYPED_TEST_SUITE_P(LookupTest, At, OperatorBracket, Count, Find,
EqualRange);
} // namespace container_internal
} // namespace priv
} // namespace phmap
#endif // PHMAP_CONTAINER_INTERNAL_UNORDERED_MAP_LOOKUP_TEST_H_
#endif // PHMAP_PRIV_UNORDERED_MAP_LOOKUP_TEST_H_
+5 -5
View File
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef PHMAP_CONTAINER_INTERNAL_UNORDERED_MAP_MEMBERS_TEST_H_
#define PHMAP_CONTAINER_INTERNAL_UNORDERED_MAP_MEMBERS_TEST_H_
#ifndef PHMAP_PRIV_UNORDERED_MAP_MEMBERS_TEST_H_
#define PHMAP_PRIV_UNORDERED_MAP_MEMBERS_TEST_H_
#include <type_traits>
@@ -31,7 +31,7 @@
#endif
namespace phmap {
namespace container_internal {
namespace priv {
template <class UnordMap>
class MembersTest : public ::testing::Test {};
@@ -89,7 +89,7 @@ TYPED_TEST_P(MembersTest, BeginEnd) {
REGISTER_TYPED_TEST_SUITE_P(MembersTest, Typedefs, SimpleFunctions, BeginEnd);
} // namespace container_internal
} // namespace priv
} // namespace phmap
#endif // PHMAP_CONTAINER_INTERNAL_UNORDERED_MAP_MEMBERS_TEST_H_
#endif // PHMAP_PRIV_UNORDERED_MAP_MEMBERS_TEST_H_
+5 -5
View File
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef PHMAP_CONTAINER_INTERNAL_UNORDERED_MAP_MODIFIERS_TEST_H_
#define PHMAP_CONTAINER_INTERNAL_UNORDERED_MAP_MODIFIERS_TEST_H_
#ifndef PHMAP_PRIV_UNORDERED_MAP_MODIFIERS_TEST_H_
#define PHMAP_PRIV_UNORDERED_MAP_MODIFIERS_TEST_H_
#ifdef _MSC_VER
#pragma warning(push, 0)
@@ -29,7 +29,7 @@
#endif
namespace phmap {
namespace container_internal {
namespace priv {
template <class UnordMap>
class ModifiersTest : public ::testing::Test {};
@@ -275,7 +275,7 @@ REGISTER_TYPED_TEST_SUITE_P(ModifiersTest, Clear, Insert, InsertHint,
Emplace, EmplaceHint, TryEmplace, TryEmplaceHint,
Erase, EraseRange, EraseKey, Swap);
} // namespace container_internal
} // namespace priv
} // namespace phmap
#endif // PHMAP_CONTAINER_INTERNAL_UNORDERED_MAP_MODIFIERS_TEST_H_
#endif // PHMAP_PRIV_UNORDERED_MAP_MODIFIERS_TEST_H_
+5 -5
View File
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef PHMAP_CONTAINER_INTERNAL_UNORDERED_SET_CONSTRUCTOR_TEST_H_
#define PHMAP_CONTAINER_INTERNAL_UNORDERED_SET_CONSTRUCTOR_TEST_H_
#ifndef PHMAP_PRIV_UNORDERED_SET_CONSTRUCTOR_TEST_H_
#define PHMAP_PRIV_UNORDERED_SET_CONSTRUCTOR_TEST_H_
#include <algorithm>
#include <unordered_set>
@@ -25,7 +25,7 @@
#include "hash_policy_testing.h"
namespace phmap {
namespace container_internal {
namespace priv {
template <class UnordMap>
class ConstructorTest : public ::testing::Test {};
@@ -487,7 +487,7 @@ REGISTER_TYPED_TEST_SUITE_P(
MoveAssignmentOverwritesExisting,
AssignmentFromInitializerListOverwritesExisting, AssignmentOnSelf);
} // namespace container_internal
} // namespace priv
} // namespace phmap
#endif // PHMAP_CONTAINER_INTERNAL_UNORDERED_SET_CONSTRUCTOR_TEST_H_
#endif // PHMAP_PRIV_UNORDERED_SET_CONSTRUCTOR_TEST_H_
+5 -5
View File
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef PHMAP_CONTAINER_INTERNAL_UNORDERED_SET_LOOKUP_TEST_H_
#define PHMAP_CONTAINER_INTERNAL_UNORDERED_SET_LOOKUP_TEST_H_
#ifndef PHMAP_PRIV_UNORDERED_SET_LOOKUP_TEST_H_
#define PHMAP_PRIV_UNORDERED_SET_LOOKUP_TEST_H_
#include "gmock/gmock.h"
#include "gtest/gtest.h"
@@ -21,7 +21,7 @@
#include "hash_policy_testing.h"
namespace phmap {
namespace container_internal {
namespace priv {
template <class UnordSet>
class LookupTest : public ::testing::Test {};
@@ -83,7 +83,7 @@ TYPED_TEST_P(LookupTest, EqualRange) {
REGISTER_TYPED_TEST_SUITE_P(LookupTest, Count, Find, EqualRange);
} // namespace container_internal
} // namespace priv
} // namespace phmap
#endif // PHMAP_CONTAINER_INTERNAL_UNORDERED_SET_LOOKUP_TEST_H_
#endif // PHMAP_PRIV_UNORDERED_SET_LOOKUP_TEST_H_
+5 -5
View File
@@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef PHMAP_CONTAINER_INTERNAL_UNORDERED_SET_MEMBERS_TEST_H_
#define PHMAP_CONTAINER_INTERNAL_UNORDERED_SET_MEMBERS_TEST_H_
#ifndef PHMAP_PRIV_UNORDERED_SET_MEMBERS_TEST_H_
#define PHMAP_PRIV_UNORDERED_SET_MEMBERS_TEST_H_
#include <type_traits>
#include "gmock/gmock.h"
#include "gtest/gtest.h"
namespace phmap {
namespace container_internal {
namespace priv {
template <class UnordSet>
class MembersTest : public ::testing::Test {};
@@ -77,7 +77,7 @@ TYPED_TEST_P(MembersTest, BeginEnd) {
REGISTER_TYPED_TEST_SUITE_P(MembersTest, Typedefs, SimpleFunctions, BeginEnd);
} // namespace container_internal
} // namespace priv
} // namespace phmap
#endif // PHMAP_CONTAINER_INTERNAL_UNORDERED_SET_MEMBERS_TEST_H_
#endif // PHMAP_PRIV_UNORDERED_SET_MEMBERS_TEST_H_
+5 -5
View File
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef PHMAP_CONTAINER_INTERNAL_UNORDERED_SET_MODIFIERS_TEST_H_
#define PHMAP_CONTAINER_INTERNAL_UNORDERED_SET_MODIFIERS_TEST_H_
#ifndef PHMAP_PRIV_UNORDERED_SET_MODIFIERS_TEST_H_
#define PHMAP_PRIV_UNORDERED_SET_MODIFIERS_TEST_H_
#include "gmock/gmock.h"
#include "gtest/gtest.h"
@@ -21,7 +21,7 @@
#include "hash_policy_testing.h"
namespace phmap {
namespace container_internal {
namespace priv {
template <class UnordSet>
class ModifiersTest : public ::testing::Test {};
@@ -182,7 +182,7 @@ REGISTER_TYPED_TEST_SUITE_P(ModifiersTest, Clear, Insert, InsertHint,
InsertRange, Emplace, EmplaceHint, Erase, EraseRange,
EraseKey, Swap);
} // namespace container_internal
} // namespace priv
} // namespace phmap
#endif // PHMAP_CONTAINER_INTERNAL_UNORDERED_SET_MODIFIERS_TEST_H_
#endif // PHMAP_PRIV_UNORDERED_SET_MODIFIERS_TEST_H_