According to cppreference, std::allocator_traits::construct just calls placement new by default. I cannot imagine any practical reason to use the former rather than the latter.
My questions are:
- Why does
std::allocator_traitsneedconstructwhileplacement newis enough? - Is there any use case showing the former has obvious advantages over the latter?
Aucun commentaire:
Enregistrer un commentaire