istreambuf_iterator::equal

입력된 스트림 버퍼의 두 반복기 사이의 동일성을 테스트 합니다.

bool equal(
   const istreambuf_iterator<CharType, Traits>& _Right
) const;

매개 변수

  • _Right
    같은지 여부를 확인 하는 작업에 대 한 반복기입니다.

반환 값

true 이면 모두 istreambuf_iterators는 스트림의 끝 반복기 또는 둘 다 경우 아니면 스트림의 끝 반복기입니다. 그렇지 않으면 거짓.

설명

범위를 정의 istreambuf_iterator 현재 위치가 스트림의 끝 반복기와 있지만 이후 모든 비-끝-의 스트림 반복기에서 동일 하지는 같은 멤버 함수가 아닙니다를 사용 하 여 모든 차원이 정의할 수 istreambuf_iterators.== 및 != 연산자 같은 의미가 있습니다.

예제

// istreambuf_iterator_equal.cpp
// compile with: /EHsc
#include <iterator>
#include <iostream>

int main( )
{
   using namespace std;

   cout << "(Try the example: 'Hello world!'\n"
        << " then an Enter key to insert into the output,\n"
        << " & use a ctrl-Z Enter key combination to exit): ";

   istreambuf_iterator<char> charReadIn1 ( cin );
   istreambuf_iterator<char> charReadIn2 ( cin );

   bool b1 = charReadIn1.equal ( charReadIn2 );

   if (b1)
      cout << "The iterators are equal." << endl;
   else
      cout << "The iterators are not equal." << endl;
}
  Hello world!
  Hello world!
(예제: 'Hello world!' 다음에 출력 키 & 끝내려면 ctrl + Z Enter 키 조합 하 여 사용): Hello world! 반복기는 같습니다.

요구 사항

헤더: <iterator>

네임 스페이스: std

참고 항목

참조

istreambuf_iterator Class

표준 템플릿 라이브러리