Slicing a vector in C++

后端 未结 4 501
执念已碎
执念已碎 2020-12-29 01:54

Is there an equivalent of list slicing [1:] from Python in C++ with vectors? I simply want to get all but the first element from a vector.

Python\'s lis

4条回答
  •  误落风尘
    2020-12-29 02:50

    I know it's late but have a look at valarray and its slices. If you are using a vector of some sort of NumericType, then it's worth giving it a try.

提交回复
热议问题