Jump to content
  • Advertisement


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


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

This topic is 5706 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
- 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;

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


[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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!