S
SUPER_SOCKO
I am new to STL. I don't know how to access a multiset of a list.
My code is the following:
#include <list>
#include <iostream>
#include <set>
using namespace std;
typedef multiset <int, less<int> > Int_Bag;
// typedef list <Int_Bag> lib;
void testContainer (void) {
list <Int_Bag> ListBag;
Int_Bag ib;
ib.insert(5);
ib.insert(2);
ib.insert(7);
ListBag.push_back(ib);
cout << "Size of the list is " << ListBag.size() << endl; // output 1
list <Int_Bag>::iterator ListBag_Iter;
for(ListBag_Iter = ListBag.begin(); ListBag_Iter != ListBag.end(); ++ListBag_Iter)
; // I need some help.
// for(ib_Iter = lb_Iter->iterator(); ib_Iter != lb_Iter->end(); ++ib_Iter)
// cout << *(lb_Iter) << endl;
}
I wait for your suggestion.
Thank you.
My code is the following:
#include <list>
#include <iostream>
#include <set>
using namespace std;
typedef multiset <int, less<int> > Int_Bag;
// typedef list <Int_Bag> lib;
void testContainer (void) {
list <Int_Bag> ListBag;
Int_Bag ib;
ib.insert(5);
ib.insert(2);
ib.insert(7);
ListBag.push_back(ib);
cout << "Size of the list is " << ListBag.size() << endl; // output 1
list <Int_Bag>::iterator ListBag_Iter;
for(ListBag_Iter = ListBag.begin(); ListBag_Iter != ListBag.end(); ++ListBag_Iter)
; // I need some help.
// for(ib_Iter = lb_Iter->iterator(); ib_Iter != lb_Iter->end(); ++ib_Iter)
// cout << *(lb_Iter) << endl;
}
I wait for your suggestion.
Thank you.