locked
Platform::Array to std::vector RRS feed

  • Question

  • Hi, please, what is the fastest way to initialize an std::vector< Object^ > from an Platform::Array< Object^ > 

    EDIT :

    I think I just found an answer to my question.

    // Construct a std::vector. Two options.
    vector<int> v1(begin(arr), end(arr));
    vector<int> v2(arr->begin(), arr->end());


    • Edited by t-n-x Monday, March 16, 2015 9:07 PM
    Monday, March 16, 2015 8:28 PM

Answers

  • Hello,

    // Construct a std::vector. Two options.
    vector<int> v1(begin(arr), end(arr));
    vector<int> v2(arr->begin(), arr->end());

    Thanks for sharing your solution here. It will help other community members who have similar question.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, March 17, 2015 8:57 AM
    Moderator