operator==,!=(std::scoped_allocator_adaptor)

来自cppreference.com
 
 
动态内存管理
未初始化存储
(C++17)
垃圾收集支持
杂项
(C++20)
(C++11)
(C++11)
C 库
低层内存管理
 
 
template< class OuterAlloc1, class OuterAlloc2, class... InnerAllocs >

bool operator==( const scoped_allocator_adaptor<OuterAlloc1, InnerAllocs...>& lhs,

                 const scoped_allocator_adaptor<OuterAlloc2, InnerAllocs...>& rhs ) noexcept;
(C++11 起)
template< class OuterAlloc1, class OuterAlloc2, class... InnerAllocs >

bool operator!=( const scoped_allocator_adaptor<OuterAlloc1, InnerAllocs...>& lhs,

                 const scoped_allocator_adaptor<OuterAlloc2, InnerAllocs...>& rhs ) noexcept;
(C++11 起)

比较二个 scoped_allocator_adaptors 。若满足下列条件则二个这种分配器相等:

  • lhs.outer_allocator() == rhs.outer_allocator() ,且
  • sizeof...(InnerAllocs) > 0 ,则 lhs.inner_allocator() == rhs.inner_allocator()

擦书

lhs, rhs - 要比较的 scoped_allocator_adaptors

返回值

1)lhsrhs 相等,则返回 true ,否则返回 false
2)lhsrhs 不相等,则返回 true ,否则返回 false