operator!= (<list>)

如果在运算符左侧的列表对象与右侧,的列表对象不相等测试。

bool operator!=(
   const list<Type, Allocator>& _Left,
   const list<Type, Allocator>& _Right
);

参数

  • _Left
    类型 列表对象。

  • _Right
    类型 列表对象。

返回值

true,如果列表不相等; false,如果列表为相等。

备注

之间该比较列表对象根据其元素的比较pairwise。 两个列表相等;如果它们具有相同元素数目,并且其各自的元素具有相同的值。 否则为不相等。

示例

// list_op_ne.cpp
// compile with: /EHsc
#include <list>
#include <iostream>

int main( ) 
{
   using namespace std; 
   list <int> c1, c2;
   c1.push_back( 1 );
   c2.push_back( 2 );

   if ( c1 != c2 )
      cout << "Lists not equal." << endl;
   else
      cout << "Lists equal." << endl;
}
  

要求

标头: <list>

命名空间: std

请参见

参考

标准模板库