다음을 통해 공유


multiset::count (STL/CLR)

지정 된 키와 일치 하는 요소의 수를 찾습니다.

    size_type count(key_type key);

매개 변수


  • 검색할 키 값입니다.

설명

에 해당 하는 순서는 제어 되는 시퀀스의 요소 개수를 반환 하는 멤버 함수 key.이를 통해 현재 제어되는 시퀀스에 있는 요소 중 지정된 키와 일치하는 요소의 수를 확인할 수 있습니다.

예제

// cliext_multiset_count.cpp 
// compile with: /clr 
#include <cliext/set> 
 
typedef cliext::multiset<wchar_t> Mymultiset; 
int main() 
    { 
    Mymultiset c1; 
    c1.insert(L'a'); 
    c1.insert(L'b'); 
    c1.insert(L'c'); 
 
// display initial contents " a b c" 
    for each (wchar_t elem in c1) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
    System::Console::WriteLine("count(L'A') = {0}", c1.count(L'A')); 
    System::Console::WriteLine("count(L'b') = {0}", c1.count(L'b')); 
    System::Console::WriteLine("count(L'C') = {0}", c1.count(L'C')); 
    return (0); 
    } 
 
  

요구 사항

헤더: < cliext/설정 >

네임 스페이스: cliext

참고 항목

참조

multiset (STL/CLR)

multiset::equal_range (STL/CLR)