#include<list>
#include<vector>
#include<iostream>
#include<memory>
using namespace std;
template <typename From, typename To>
unique_ptr<To> fn(From& from)
{
unique_ptr<To> to{make_unique<To>()};
for (auto p{ begin(from) }; p != end(from); ++p)
{
to->push_back(*p);
}
return to;
}
int main()
{
vector<int> v{ 55, 56, 57, 58, 59 };
unique_ptr<list<int>> ls = fn<vector<int>, list<int>>(v);
for (auto& x : *ls)
{
cout << x << endl;
}
getchar();
}