Consider
struct foo{};
struct bar{
bar(const foo& f){}
};
And imagine that I have a
std::vector<foo> vec;
and I want to convert this to a std::vector<bar> out. I can use
std::copy(vec.begin(), vec.end(), std::back_inserter(out));
to do that since bar is not explicit. However, I need bar to be explicit! But then the back_inserter no longer works. What changes do I need to make to the std::copy parameters to somehow include the explicit bar(<iteratee>)?