mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 13:15:12 +00:00
Use emplace for casting to map
This commit is contained in:
parent
52f4c3aef3
commit
f4902ece17
@ -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