如果在运算符的左边、向量、双端队列对象与右侧,的、向量、双端队列对象相等测试。
bool operator==(
const deque<Type, Allocator>& _Left,
const deque<Type, Allocator>& _Right
);
参数
_Left
deque 类型的对象。_Right
deque 类型的对象。
返回值
true,如果在运算符的左边、向量、双端队列与、向量、双端队列相等在运算符的右侧;否则 false。
备注
在、向量、双端队列对象之间的比较根据其元素的比较pairwise。两deques相等;如果它们具有相同元素数目,并且其各自的元素具有相同的值。否则为不相等。
示例
// deque_op_eq.cpp
// compile with: /EHsc
#include <deque>
#include <iostream>
int main( )
{
using namespace std;
deque <int> c1, c2;
c1.push_back( 1 );
c2.push_back( 1 );
if ( c1 == c2 )
cout << "The deques are equal." << endl;
else
cout << "The deques are not equal." << endl;
c1.push_back( 1 );
if ( c1 == c2 )
cout << "The deques are equal." << endl;
else
cout << "The deques are not equal." << endl;
}
要求
标头: <deque>
命名空间: std