std::allocator::address(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸŽ€ std::allocator::address(3) πŸŽ€

okay so bestie, this little icon is std::allocator::address, straight out of the C++ Standard Libary (yes, the header spells it like that, iconic). It’s giving β€œI just wanna know the real address” energy, and honestly? Same. πŸ’…βœ¨


✨ NAME ✨

std::allocator::address β€” std::allocator::address. That’s it, that’s the name, we been knew. 🫢


πŸ“œ Synopsis πŸ“œ

the synopsis is lowkey serving chaotic line breaks in the source, but I kept every token exactly as it appears:

          pointer address( reference x )             (until C++11)
          const;
          pointer address( reference x )             (since C++11)
          const noexcept;                            (deprecated in C++17)
                                                     (removed in C++20)
          const_pointer address(             (1)
       (until C++11)
          const_reference x ) const;
          const_pointer address(                 (2)
       (since C++11)
          const_reference x ) const
       (deprecated in
          noexcept;
       C++17)
                                                                           (removed
       in C++20)

It returns the actual address of x even in presence of overloaded operator&. no cap, that’s the whole vibe. 🌸

heads up: the page marks this deprecated in C++17 and removed in C++20 β€” so if you see it out in the wild, it’s giving legacy era. πŸ˜­πŸ’€

🌸 Parameters 🌸

  • x β€” the object to acquire address of.

πŸ’– Return value πŸ’–

The actual address of x. periodt. ✨


🩹 Defect reports 🩹

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

  • DR LWG 634 (N2436) β€” applied to C++98.
    • Behavior as published: the return value is &x (which is affected by overloaded operator&).
    • Correct behavior: returns the actual address of x.

okay bye bestie 🫢 this page came from http://cppreference.com, dated 2024.06.10, and it’s the std::allocator::address(3) page. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from