mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 06:35:12 +00:00
Merge pull request #129 from bennybp/master
Use emplace for casting to map
This commit is contained in:
commit
98e9210816
@ -72,7 +72,7 @@ template <typename Type, typename Key, typename Value> struct map_caster {
|
||||
if (!kconv.load(it.first.ptr(), convert) ||
|
||||
!vconv.load(it.second.ptr(), convert))
|
||||
return false;
|
||||
value[(Key) kconv] = (Value) vconv;
|
||||
value.emplace((Key) kconv, (Value) vconv);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user