Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 694 Bytes

op_not_equal.md

File metadata and controls

48 lines (36 loc) · 694 Bytes

operator!=

  • memory[meta header]
  • std[meta namespace]
  • function template[meta id-type]
// C++03
template <class T1, class T2>
bool operator!=(const allocator<T1>&, const allocator<T2>&) throw();

// C++11
template <class T, class U>
bool operator!=(const allocator<T>&, const allocator<U>&) noexcept;

概要

2つのallocatorオブジェクトを非等値比較する。

戻り値

false

#include <iostream>
#include <memory>

int main()
{
  std::allocator<int> a;
  std::allocator<int> b;

  if (a != b) {
    std::cout << "not equal" << std::endl;
  }
  else {
    std::cout << "equal" << std::endl;
  }
}

出力例

equal