Jump to content
  • Advertisement

Archived

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

stodge

STL Containers within STL containers? How to....

This topic is 5615 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 know it''s possible to declare/compile this:
  
typedef std::vector<hbBaseEventObserver*>HBeventObserverQueue;
typedef std::multimap<HBint, HBeventObserverQueue>HBeventObserverGroup;

HBeventObserverGroup    mObservers;
  
But how would I insert something into the vector? Thanks

Share this post


Link to post
Share on other sites
Advertisement
- Since is a multimap, I assume you have many values associated to a key, rite?
- So you need to find the targeted vector within range [LowerBound(HBint), UpperBound(HBInt)]
- Once you got the correct vector, you can do whatever with it.

Share this post


Link to post
Share on other sites
Here is one example.


    
typedef std::pair<HBint, HBeventObserverQueue> pairHintBOSQ;

hbBaseEventObserver *pBEO = new hbBaseEventObserver;
HBint theHint;

HBeventObserverQueue theBOS;
theBOS.push_back(pBEO);

HBeventObserverGroup theMap;
theMap.insert(pairHintBOSQ(theHint, theBOS));


Kuphryn


[edited by - kuphryn on February 6, 2003 7:55:11 PM]

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!