S
Sensei
Hi!
I'm looking for something similar to the map container, but with a
slight modification, a unique key, with multiple assignments to each
one. I think some container in the STL has it, but I cannot see it.
So I can assign to a key like a map:
// pseudo c++ code
container<int, int> m;
// 1: <2, -3, 5>
m[1] = 2;
m[1] = -3;
m[1] = 5;
// 2: <7, 1, 0, -1, 8>
m[2] = 7;
m[2] = 1;
m[2] = 0;
m[2] = -1;
m[2] = 8;
And get an iterator for each key:
for (it = m[1].begin(); it != m[1].end(); it++)
cout << "this is " << (*it) << endl;
The result would be something like a
map< key_T, list<data_T> >
without hassles
Thanks to anyone!!
I'm looking for something similar to the map container, but with a
slight modification, a unique key, with multiple assignments to each
one. I think some container in the STL has it, but I cannot see it.
So I can assign to a key like a map:
// pseudo c++ code
container<int, int> m;
// 1: <2, -3, 5>
m[1] = 2;
m[1] = -3;
m[1] = 5;
// 2: <7, 1, 0, -1, 8>
m[2] = 7;
m[2] = 1;
m[2] = 0;
m[2] = -1;
m[2] = 8;
And get an iterator for each key:
for (it = m[1].begin(); it != m[1].end(); it++)
cout << "this is " << (*it) << endl;
The result would be something like a
map< key_T, list<data_T> >
without hassles
Thanks to anyone!!