Is slicing a vector faster than copying each element into a new vector?

前端 未结 0 425
隐瞒了意图╮
隐瞒了意图╮ 2020-12-20 14:09

Let\'s say I have a vector of 10 ints and I want to create 2 subvectors each of 5 elements.

Is it faster if I slice the vector like this:

vector

        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题