What is the most efficient way to convert a std::vector to a .NET List?
To give some context, I am wrapping an unmanaged C++ class with C++/CLI. The C++/CLI class holds
Consider turning into the vector directly into an array .. the below will work and be valid, until you resize the vector.
vector vec(10); int *array = &vec[0];
Then, you should be able to treat that (I think -- VS not on machine) as a passed array to populate your list.
You should also create your list with a size that you expect to need -- adding one by one will be slow.