From b85eef75cfcd95e108521e2cd84dbe6aff4aa2e4 Mon Sep 17 00:00:00 2001 From: Dllieu Date: Tue, 17 Oct 2017 20:24:06 +0800 Subject: [PATCH] Fix iterator on empty map --- flat_hash_map.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flat_hash_map.hpp b/flat_hash_map.hpp index b6f991c..2b3a384 100644 --- a/flat_hash_map.hpp +++ b/flat_hash_map.hpp @@ -521,6 +521,7 @@ class sherwood_v3_table : private EntryAlloc, private Hasher, private Equal if (it->has_value()) return { it }; } + return end(); } const_iterator begin() const { @@ -529,6 +530,7 @@ class sherwood_v3_table : private EntryAlloc, private Hasher, private Equal if (it->has_value()) return { it }; } + return cend(); } const_iterator cbegin() const {