By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,134 Members | 1,195 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,134 IT Pros & Developers. It's quick & easy.

multimap stl

P: n/a
i must create a muiltimap with 2 string , 1 int and 1 iterator to
multimap itself

how could define the typedef?
thank

Dec 21 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
gi***************@gmail.com wrote:
i must create a muiltimap with 2 string , 1 int and 1 iterator to
multimap itself

how could define the typedef?
Ask yourself, "what is the key?" and "what is the data?".
Dec 21 '06 #2

P: n/a
one string is a key other are the date

Gianni Mariani wrote:
gi***************@gmail.com wrote:
i must create a muiltimap with 2 string , 1 int and 1 iterator to
multimap itself

how could define the typedef?

Ask yourself, "what is the key?" and "what is the data?".
Dec 21 '06 #3

P: n/a
gi***************@gmail.com wrote:
one string is a key other are the date
Don't top post. Replies go after whatever you're responding to.
Gianni Mariani wrote:
>gi***************@gmail.com wrote:
>>i must create a muiltimap with 2 string , 1 int and 1 iterator to
multimap itself

how could define the typedef?
Ask yourself, "what is the key?" and "what is the data?".
A map (or multimap) key and data must be *types*. The key can be a
string, but the data cannot be "a string, an int, and an iterator"
because that is three types, not a single type. Probably the
appropriate thing to do is define a class or structure to hold those
three quantities and make that class or structure the data type.

struct BunchOfTypes
{
string s;
int i;
multimap<string,BunchOfTypes>::iterator iter;
};
Dec 21 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.