mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-11 08:50:31 +00:00
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:
committed by
Jason Rhinelander
parent
28cb6764fc
commit
05d379a9aa
@@ -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);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user