operator!= (<memory>)

Tests for inequality between objects.

template<class Type, class Other>
   bool operator!=(
      const allocator<Type>& _Left,
      const allocator<Other>& _Right
   ) throw();
template<class Type1, class Del1, class Type2, class Del2>
    bool operator!=(
        const unique_ptr<Type1, Del1>& _Left,
        const unique_ptr<Type2&, Del2>& _Right
);

Parameters

  • _Left
    One of the objects to be tested for inequality.

  • _Right
    One of the objects to be tested for inequality.

Return Value

true if the objects are not equal; false if objects are equal.

Remarks

The first template operator returns false. (All default allocators are equal.)

The second and third template operators return !(_Left == _Right).

Example

// memory_op_me.cpp
// compile with: /EHsc
#include <memory>
#include <iostream>
#include <vector>

using namespace std;

int main( ) 
{
   allocator<double> Alloc;
   vector <char>:: allocator_type v1Alloc;

   if ( Alloc != v1Alloc )
      cout << "The allocator objects Alloc & v1Alloc not are equal."
           << endl;
   else
      cout << "The allocator objects Alloc & v1Alloc are equal."
           << endl;
}

The allocator objects Alloc & v1Alloc are equal.

Requirements

Header: <memory>

Namespace: std

See Also

Reference

auto_ptr Class

shared_ptr Class

shared_ptr::operator!=

Other Resources

auto_ptr Members

unique_ptr Class

unique_ptr Members