gerard4143
Nearly a Posting Maven
2,272 posts since Jan 2008
Reputation Points: 512
Solved Threads: 387
How do you intend to use this?
Why wouldn't a simple std::vector be sufficient?
Fbody
Posting Maven
2,930 posts since Oct 2009
Reputation Points: 833
Solved Threads: 393
So is it your intent to create data pairs, then count the number of data pairs that contain a specific first value?
EDIT: NVM, overlapped....
Fbody
Posting Maven
2,930 posts since Oct 2009
Reputation Points: 833
Solved Threads: 393
The multimap class includes a function, called equal_range , which returns the range (as iterator pair) of elements of the multimap that have the same key. Finding the number of elements with the same key is simply a matter of counting the elements in that range.
If your purpose is to construct a graph of some kind, you might want to take a look at the Boost.Graph Library (BGL) which has all sorts of graph / tree containers and algorithms.
mike_2000_17
Posting Virtuoso
2,139 posts since Jul 2010
Reputation Points: 1,634
Solved Threads: 457