Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Squirell

Vector Problems

This topic is 5116 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im trying to use erase() for vectors my code is something like this: vector <NODE> ObjectList; NODE temp; ObjectList.push_back(temp); ObjectList.push_back(temp); ObjectList.push_back(temp); ObjectList.erase(1); //This the compiler says doesnt work What am i doing wrong? [Edit: Forums swallowed your template instantiation.] [edited by - Oluseyi on May 24, 2004 8:43:27 PM]

Share this post


Link to post
Share on other sites
Advertisement
std::vector::erase doesn''t take an integer index as a parameter, it takes an iterator. Try ObjectList.erase(ObjectList.begin());

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!