std::experi...do_is_equal(3)
hii bestie π welcome to std::experi...do_is_equal(3), a page from the C++ Standard Libary manual (yes, that's the spelling from the page, I don't make the rules π
). this one is short, iconic, and fully about vibe-checking equality between memory resources. let's get into it π«Ά
β¨ NAME β¨
std::experimental::pmr::memory_resource::do_is_equal β std::experimental::pmr::memory_resource::do_is_equal
(yes bestie, the page literally names it twice; not me making that up π )
πΈ Synopsis πΈ
virtual bool is_equal( const memory_resource& other ) (library
fundamentals TS)
const noexcept = 0;
okay so this is the library fundamentals TS version, and the (library fundamentals TS) note is just hanging out there β still, the signature is the signature. also: = 0 means it's pure virtual, so a derived class has to bring the actual implementation. no cap.
Compares *this for equality with other. Two memory_resources compare equal if and only if memory allocated from one memory_resource can be deallocated from the other and vice versa. that's the whole equality contract, and it's honestly kind of iconic π₯
π§ Notes π§
The most-derived type of other may not match the most derived type of *this. so a derived class implementation therefore must typically check whether the most derived types of *this and other match using dynamic_cast, and immediately return false if the cast fails. like, do not pass go, do not collect vibes, just false π
bestie reminder:dynamic_castcheck first, earlyfalseif it fails. that's the vibe check.
π See also π
is_equalβ compare for equality with anothermemory_resource(public member function)
π·οΈ Category: π·οΈ
Noindexed pages
source: http://cppreference.com Β· version/date: 2024.06.10 Β· page: std::experi...do_is_equal(3) β bye bestie, go deallocate responsibly and slay πβ¨π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms