aboutsummaryrefslogtreecommitdiff
path: root/test/std/containers/unord/unord.map/unord.map.cnstr/allocator.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/containers/unord/unord.map/unord.map.cnstr/allocator.pass.cpp')
-rw-r--r--test/std/containers/unord/unord.map/unord.map.cnstr/allocator.pass.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/allocator.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/allocator.pass.cpp
index 3c3ec058ead7..232f2fd4fd59 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/allocator.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/allocator.pass.cpp
@@ -65,7 +65,25 @@ int main()
assert(c.load_factor() == 0);
assert(c.max_load_factor() == 1);
}
-#if _LIBCPP_STD_VER > 11
+ {
+ typedef explicit_allocator<std::pair<const NotConstructible, NotConstructible>> A;
+ typedef std::unordered_map<NotConstructible, NotConstructible,
+ test_hash<std::hash<NotConstructible> >,
+ test_compare<std::equal_to<NotConstructible> >,
+ A
+ > C;
+ C c(A{});
+ LIBCPP_ASSERT(c.bucket_count() == 0);
+ assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
+ assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
+ assert(c.get_allocator() == A{});
+ assert(c.size() == 0);
+ assert(c.empty());
+ assert(std::distance(c.begin(), c.end()) == 0);
+ assert(c.load_factor() == 0);
+ assert(c.max_load_factor() == 1);
+ }
+#if TEST_STD_VER > 11
{
typedef NotConstructible T;
typedef test_allocator<std::pair<const T, T>> A;