Notitie
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen u aan te melden of de directory te wijzigen.
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen de mappen te wijzigen.
shared_ptr equal comparison.
template<class Ty1, class Ty2>
bool operator==(const shared_ptr<Ty1>& left;,
const shared_ptr<Ty2>& right);
Parameters
Ty1
The type controlled by the left shared pointer.Ty2
The type controlled by the right shared pointer.left
The left shared pointer.right
The right shared pointer.
Remarks
The template operator returns left.get() == right.get().
Example
// std_tr1__memory__operator_eq.cpp
// compile with: /EHsc
#include <memory>
#include <iostream>
int main()
{
std::tr1::shared_ptr<int> sp0(new int(0));
std::tr1::shared_ptr<int> sp1(new int(0));
std::cout << "sp0 == sp0 == " << std::boolalpha
<< (sp0 == sp0) << std::endl;
std::cout << "sp0 == sp1 == " << std::boolalpha
<< (sp0 == sp1) << std::endl;
return (0);
}
sp0 == sp0 == true sp0 == sp1 == false
Requirements
Header: <memory>
Namespace: std::tr1