Use emplace for casting to map

This commit is contained in:
Ben Pritchard 2016-03-05 17:36:46 -05:00
parent 52f4c3aef3
commit f4902ece17

View File

@ -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;
}