Fix access of protected member, and add test for templated swap()

This commit is contained in:
greg7mdp
2022-09-11 12:16:35 -04:00
parent 0d912f754f
commit f0409c6d05
4 changed files with 37 additions and 2 deletions
+10
View File
@@ -22,6 +22,10 @@
#define THIS_EXTRA_TPL_PARAMS
#endif
#ifndef THIS_EXTRA_TPL_PARAMS_NULLMUTEX
#define THIS_EXTRA_TPL_PARAMS_NULLMUTEX
#endif
#include "parallel_hashmap/phmap.h"
#if defined(PHMAP_HAVE_STD_ANY)
@@ -62,6 +66,12 @@ template <class K, class V, class H = phmap::priv::hash_default_hash<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>;
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_NullMutex = THIS_HASH_MAP<K, V, H, Eq, Alloc THIS_EXTRA_TPL_PARAMS_NULLMUTEX>;
static_assert(!std::is_standard_layout<NonStandardLayout>(), "");