Is it possible to use std:fill to fill an array of unique_ptrs? The intention is to have distinct pointers to distinct objects which are initialize
std:fill
unique_ptr
I don't think you can do it with std::fill() but it is trivial to do with std::generate():
std::fill()
std::generate()
std::unique_ptr array[10]; std::generate(std::begin(array), std::end(array), []{ return std::unique_ptr(new int(17)); });