Is it possible to use std:fill
to fill an array of unique_ptr
s? The intention is to have distinct pointers to distinct objects which are initialized with the same parameters.
For example:
std::unique_ptr<int> ar[3];
std::fill(ar.begin(), ar.end(), make_unique_for_each_element_somehow<int>(1));
Aucun commentaire:
Enregistrer un commentaire