void Test()
{
vector< unique_ptr<char[]>> v;
for(size_t i = 0; i < 5; ++i)
{
char* p = new char[10];
sprintf_s(p, 10, "string %d", i);
v.push_back( unique_ptr<char[]>(p) );
}
for(auto s : v) // error is here
{
cout << s << endl;
}
}
error C2248: 'std::unique_ptr<_Ty>::unique_ptr' : cannot access private member declared in class 'std::unique_ptr<_Ty>'