Udostępnij za pośrednictwem


hash_multiset::size

Returns the number of elements in the hash_multiset.

size_type size( ) const;

Return Value

The current length of the hash_multiset.

Remarks

In Visual C++ .NET 2003, members of the <hash_map> and <hash_set> header files are no longer in the std namespace, but rather have been moved into the stdext namespace. See The stdext Namespace for more information.

Example

// hash_multiset_size.cpp
// compile with: /EHsc
#define _DEFINE_DEPRECATED_HASH_CLASSES 0
#include <hash_set>
#include <iostream>

int main( )
{
   using namespace std;
   using namespace stdext;
   hash_multiset <int> hms1;
   hash_multiset <int> :: size_type i;
   
   hms1.insert( 1 );
   i = hms1.size( );
   cout << "The hash_multiset length is " << i << "." << endl;

   hms1.insert( 2 );
   i = hms1.size( );
   cout << "The hash_multiset length is now " << i << "." << endl;
}
The hash_multiset length is 1.
The hash_multiset length is now 2.

Requirements

Header: <hash_set>

Namespace: stdext

See Also

Reference

hash_multiset Class

Standard Template Library

Other Resources

hash_multiset Members