operator!= <memory>

shared_ptr not 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 == right).

Example

 

// std_tr1__memory__operator_ne.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 == false sp0 != sp1 == true

Requirements

Header: <memory>

Namespace: std::tr1

See Also

Reference

<memory> (TR1)

shared_ptr Class

operator== <memory>

operator< <memory>