How to convert System::array to std::vector?
问题 Is there any easy way to convert a CLI/.NET System::array to a C++ std::vector , besides doing it element-wise? I'm writing a wrapper method ( SetLowerBoundsWrapper, below ) in CLI/C++ that accepts a System::array as an argument, and passes the equivalent std::vector to a native C++ method ( set_lower_bounds ). Currently I do this as follows: using namespace System; void SetLowerBoundsWrapper(array<double>^ lb) { int n = lb->Length; std::vector<double> lower(n); //create a std::vector for(int