다음을 통해 공유


bitset::operator!=

지정한 bitset에는 대상 bitset 다른 지 테스트합니다.

bool operator !=(
   const bitset<N>& _Right
) const;

매개 변수

  • _Right
    대상 bitset 다른 지 비교할 수 bitset.

반환 값

true 이면 bitsets는 다르면. false 이면 같은 경우.

설명

Bitsets 멤버 연산자 함수에서 값이 같지 않은지 테스트 같은 크기 여야 합니다.

예제

// bitset_op_NE.cpp
// compile with: /EHsc
#include <bitset>
#include <iostream>

int main( )
{
   using namespace std;

   bitset<5> b1 ( 7 );
   bitset<5> b2 ( 7 );
   bitset<5> b3 ( 2 );
   bitset<4> b4 ( 7 );

   if ( b1 != b2 )
      cout << "Bitset b1 is different from bitset b2." << endl;
   else
      cout << "Bitset b1 is the same as bitset b2." << endl;

   if ( b1 != b3 )
      cout << "Bitset b1 is different from bitset b3." << endl;
   else
      cout << "Bitset b1 is the same as bitset b3." << endl;

   // This would cause an error because bitsets must have the
   // same size to be tested
   // if ( b1 != b4 )
   //   cout << "Bitset b1 is different from bitset b4." << endl;
   // else
   //   cout << "Bitset b1 is the same as bitset b4." << endl;
}
  
  

요구 사항

헤더: <bitset>

네임 스페이스: std

참고 항목

참조

bitset Class