Jump to content
  • Advertisement
Sign in to follow this  
JimmyDeemo

Using boost::ptr_vector.

This topic is 3724 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

I've been reading a lot that if i'm makeing a vector of pointers that its proabably best to use boost::ptr_vector. But i'm finding it confusing as to how i access the pointers containe in the structure. Do i iterate through its like a would normally? Does that mean i need a boost::ptr_vector::iterator or something like that? I'm intending to use ptr_vector for a state stack. Could someone give me an example of using the ptr_vector strucutre for this purpose? (i.e. can i just just push_back() and pop_back()?, so i need to dereference anything i've got to access the pointer?) Perhaps i'm just confused as to how it works.

Share this post


Link to post
Share on other sites
Advertisement
I have now managed to find this in the documentation. I believe section 2 tells me what i need to know, is that right?

Side Note: I'm finding Boost documentation hard to navigate and find what i need to know. Anyone else find this?

Share this post


Link to post
Share on other sites
Most of the documentation for Boost is pretty straightforward if you know what you're looking for.

Have you tried starting here for the Boost Pointer Containers library? It might be a better place to start than the examples page.

Share this post


Link to post
Share on other sites
Yes thats much better. I can also see how to get there now. Its probably the best idea to start at the root of the documentation and filter down. It does seem like there is loads of info there, just had trouble finding it thats all.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!