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_traits
needconstruct
whileplacement new
is enough? - Is there any use case showing the former has obvious advantages over the latter?
Aucun commentaire:
Enregistrer un commentaire