Namespaces
Variants

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

From cppreference.net
Memory management library
( exposition only* )
Allocators
Uninitialized memory algorithms
Constrained uninitialized memory algorithms
Memory resources
Uninitialized storage (until C++20)
( until C++20* )
( until C++20* )
( until C++20* )

Garbage collector support (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
定义于头文件 <scoped_allocator>
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 起)
(C++20 前)

比较两个作用域分配器适配器。两个这样的分配器在以下情况下相等:

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

!= 运算符由 operator== 合成生成

(since C++20)

参数

lhs, rhs - 用于比较的作用域分配器适配器

返回值

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