c++ - Remove first item of vector -


here type :

struct rule     {         int m_id = -1;         std::wstring name;         double angle;     }; 

vector of type :

std::vector<rule>& toppriorityrules; 

i trying erase first element:

toppriorityrules.erase(toppriorityrules.begin()); 

but can't it. looks need iterator overloading.

can 1 suggest iterator overloading struct?

given

std::vector<rule>& toppriorityrules; 

the correct way remove first element of referenced vector

toppriorityrules.erase(toppriorityrules.begin()); 

which suggested.

looks need iterator overloading.

there no need overload iterator in order erase first element of std::vector.


p.s. vector (dynamic array) wrong choice of data structure if intend erase front.


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -