How to cheaply assign C-style array to std::vector?

后端 未结 4 1410
[愿得一人]
[愿得一人] 2020-12-01 16:13

Currently I do the following:

// float *c_array = new float[1024];

void Foo::foo(float *c_array, size_t c_array_size) {
  //std::vector cpp_arr         


        
4条回答
  •  温柔的废话
    2020-12-01 16:32

    Currently, the std::vector interface does not possess the capacity to move from or swap with anything except another std::vector.

提交回复
热议问题