# operator==, operator!= (std::experimental::pmr::memory_resource)

> C++ Atlas: `cppatlas.com/w/cpp/experimental/memory_resource/operator_eq` | Source: https://en.cppreference.com/w/cpp/experimental/memory_resource/operator_eq | Domain: Technical specifications

Compares the memory_resources a and b for equality. Two memory_resources compare equal if and only if memory allocated from one memory_resource can be deallocated from the other and vice versa.

## Official Specification Summary (cppreference)

```cpp
bool operator==( const memory_resource& a, const memory_resource& b ) noexcept; // (1) (library fundamentals TS)
bool operator!=( const memory_resource& a, const memory_resource& b ) noexcept; // (2) (library fundamentals TS)
```

Compares the `memory_resource`s `a` and `b` for equality. Two `memory_resource`s compare equal if and only if memory allocated from one `memory_resource` can be deallocated from the other and vice versa.

### Return value

1) `&a == &b || a.is_equal(b)`

2) `!(a == b)`

### See also

- [`is_equal`](https://en.cppreference.com/w/cpp/experimental/memory_resource/is_equal): compare for equality with another `memory_resource` (public member function)

---
Attribution: content from https://en.cppreference.com/w/cpp/experimental/memory_resource/operator_eq (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.