Поделиться через


operator!= <memory>

shared_ptr not equal comparison.

template<class Ty1, class Ty2>
    bool operator!=(const shared_ptr<Ty1>& left,
        const shared_ptr<Ty2>& right);

Параметры

  • 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.

Заметки

The template operator returns !(left == right).

Пример

 

// std_tr1__memory__operator_ne.cpp 
// compile with: /EHsc 
#include <memory> 
#include <iostream> 
 
int main() 
    { 
    std::shared_ptr<int> sp0(new int(0)); 
    std::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

Требования

Header: <memory>

Namespace: std

См. также

Ссылки

<memory> (TR1)

shared_ptr Class

operator== <memory>

operator< <memory>