Define multiset< int, less< int > > : multiset « set multiset « C++ Tutorial






#include <iostream>
#include <set>
#include <algorithm>

using namespace std;

int main()
{
   const int SIZE = 10;
   int a[ SIZE ] = { 7, 22, 9, 1, 18, 30, 100, 22, 85, 13 };
   typedef multiset< int, less< int > > ims;
   ims intMultiset;    // ims for "integer multiset"

   cout << "There are currently " << intMultiset.count( 15 )
        << " values of 15 in the multiset\n";   
   return 0;
}








19.10.multiset
19.10.1.Add elements into an integer set and output all added elements
19.10.2.Assign elements to another multiset with ascending order
19.10.3.Initializing Associative Containers
19.10.4.Modify or Remove a Value in a Set or Multiset
19.10.5.Use std::copy to print all elements in a multiset
19.10.6.Define multiset< int, less< int > >