fix return from std::map bindings to __delitem__ (#1229)

Fix return from `std::map` bindings to `__delitem__`: we should be returning `void`, not an iterator.

Also adds a test for map item deletion.
This commit is contained in:
Jeff VanOss
2018-01-11 18:43:37 -05:00
committed by Jason Rhinelander
parent 28cb6764fc
commit 05d379a9aa
2 changed files with 23 additions and 1 deletions

View File

@@ -587,7 +587,7 @@ class_<Map, holder_type> bind_map(handle scope, const std::string &name, Args&&.
auto it = m.find(k);
if (it == m.end())
throw key_error();
return m.erase(it);
m.erase(it);
}
);