Share via


operator!= (<memory>)

Tests for inequality between allocator objects of a specified class.

template<class Type, class Other>
   bool operator!=(
      const allocator<Type>& _Left,
      const allocator<Other>& _Right
   );

Parameters

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

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

Return Value

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

Remarks

Two allocator objects should compare equal only if an object allocated through one can be deallocated through the other. If the value of one object is determined from another by assignment or by construction, the two object should compare equal.

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

Other Resources

auto_ptr Members