Say I have this TArray:
TArray Vectors;
Vectors.Init(FVector(0.f, 0.f, 0.f), 10);
Now I want a smaller array with the first 5 elements.
The way I know how to do it is by doing something like this:
TArray SubVectors;
SubVectors.Emplace(Vectors[0]);
SubVectors.Emplace(Vectors[1]);
SubVectors.Emplace(Vectors[2]);
SubVectors.Emplace(Vectors[3]);
SubVectors.Emplace(Vectors[4]);
Is there an easier way to do this by passing a range start and end in one line and copy?
I’m looking for the equivalent of C++ 11 std:vector constructor 4 from this reference:
http://en.cppreference.com/w/cpp/container/vector/vector