How's that for a catchy title?
I need to convert back and forth from a CLR compliant type, like an array, and a std::vector type.
Are there any adapter methods out there, or should I just keep copying it in and out each time I call one of my native methods?
There are some interesting methods for converting between the cliext STL variant classes and CLR types, but I'm at a loss for how to get the standard vector into the STL types without a for next loop.
This is what I'm doing all over the place in this project:
vector<double> galilVector = _galilClass->arrayUpload(marshal_as<string>(arrayName));
List<double>^ arrayList = gcnew List<double>();
// Copy out the vector into a list for export to .net
for(vector<double>::size_type i = 0; i < galilVector.size(); i++)
{
arrayList->Add(galilVector[i]);
}
return arrayList->ToArray();