From 1ae3957e5cbcb6538921c60da449e3d5656999ed Mon Sep 17 00:00:00 2001 From: q66 Date: Mon, 15 Jun 2015 01:35:37 +0100 Subject: [PATCH] more hash ctors --- octa/map.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/octa/map.h b/octa/map.h index a5a191d..a76071a 100644 --- a/octa/map.h +++ b/octa/map.h @@ -64,9 +64,16 @@ public: using ConstRange = octa::HashRange>; using Allocator = A; - Map(octa::Size size = 1 << 10, const H &hf = H(), const C &eqf = C(), + explicit Map(octa::Size size, const H &hf = H(), const C &eqf = C(), const A &alloc = A()): p_table(size, hf, eqf, alloc) {} + Map(): Map(1 << 10) {} + explicit Map(const A &alloc): Map(1 << 10, H(), C(), alloc) {} + + Map(octa::Size size, const A &alloc): Map(size, H(), C(), alloc) {} + Map(octa::Size size, const H &hf, const A &alloc): Map(size, hf, C(), + alloc) {} + bool empty() const { return p_table.empty(); } octa::Size size() const { return p_table.size(); } octa::Size max_size() const { return p_table.max_size(); }