So, as I understended correctly, the main advantage of the std::aligned_storage is that it manage the align. Also it could be copied with memcpy. Also it is usable only with POD types.
But!
1) The POD types receive some align from compiler by default and we can remove the align by #pragma pack(push, 1)
2) We can copy POD with memcpy by default (we shouldnt do something for this ability)
So I cant get actually for which purposes do we need the std::aligned_storage?
Aucun commentaire:
Enregistrer un commentaire