mirror of
https://github.com/pybind/pybind11.git
synced 2025-02-16 21:57:55 +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) ||
|
if (!kconv.load(it.first.ptr(), convert) ||
|
||||||
!vconv.load(it.second.ptr(), convert))
|
!vconv.load(it.second.ptr(), convert))
|
||||||
return false;
|
return false;
|
||||||
value[(Key) kconv] = (Value) vconv;
|
value.emplace((Key) kconv, (Value) vconv);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user