相等运算符。
template<class T> bool operator==(
T t
);
参数
- t
要比较是否相等的对象。
返回值
返回 true ,如果 t 与锁定的对象,否则 false 。
示例
// msl_lock_op_eq.cpp
// compile with: /clr
#include <msclr/lock.h>
using namespace System;
using namespace System::Threading;
using namespace msclr;
int main () {
Object^ o1 = gcnew Object;
lock l1(o1);
if (l1 == o1) {
Console::WriteLine("Equal!");
}
}
要求
头文件 <msclr \ lock.h>
命名空间 msclr