I'm not aware of any standard algorithm/function included with C++ that allows that level of transformation. But is there any reason a for
loop won't work? The following is brain-compiled.
typedef System::Collections::Generic::List<class1_cli> MyList;
typedef std::vector<class1_native> MyVector;
MyList^ NativeToManaged(MyVector& v) {
MyList^ result = gcnew MyList();
if (result != nullptr) {
for (MyVector::iterator i = v.begin(); i != v.end(); ++i) {
class1_native& nativeValue = *i;
result.Add(gcnew class1_cli(nativeValue));
}
}
return result;
}