std::allocator::allocator(3)

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

🌸 NAME 🌸

std::allocator::allocator β€” the name line is literally std::allocator::allocator - std::allocator::allocator, so yeah, it’s giving β€œsame thing twice, but make it official.” This is the std::allocator::allocator(3) page from the C++ Standard Libary manual, bestie. πŸ’…

✨ Synopsis ✨

okay so the synopsis is a whole overload family reunion, and every version tag matters. here’s the exact block, no edits, no vibes lost:

          allocator() throw();                       (until C++11)
          allocator() noexcept;                      (since C++11)
                                                     (until C++20)
          constexpr allocator() noexcept;            (since C++20)
          allocator( const allocator& other                        (until
       C++11)
          ) throw();
          allocator( const allocator& other                        (since
       C++11)
          ) noexcept;                                              (until
       C++20)
          constexpr allocator( const                               (since
       C++20)
          allocator& other ) noexcept;       (1)
          template< class U >
          allocator( const allocator<U>&         (2)
       (until C++11)
          other ) throw();
          template< class U >
       (since C++11)
          allocator( const allocator<U>&             (3)
       (until C++20)
          other ) noexcept;
          template< class U >
          constexpr allocator( const
       (since C++20)
          allocator<U>& other ) noexcept;

That’s the whole overload lineup. The (until C++11), (since C++11), (until C++20), and (since C++20) tags are doing the heavy lifting, so do not skip them. πŸ”₯

They construct the default allocator. Since the default allocator is stateless, the constructors have no visible effect β€” like, none, zero, invisible, ghost behavior. πŸ‘» No cap.

πŸŽ€ Parameters πŸŽ€

  • other β€” another allocator to construct with. that’s literally the whole parameter list, and she ate. 🫢

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

πŸ“¦ where this page comes from