Count the value in multiset : multiset count « 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.12.multiset count
19.12.1.multiset.count
19.12.2.Count elements in multiset by value
19.12.3.Count the value in multiset