STD::__ALLOCATED_PTR(3cxx)

🌸 NAME 🌸

std::__allocated_ptr< _Alloc > β€” it's giving non-standard RAII type for managing pointers obtained from allocators. yes bestie, it's a libstdc++ exclusive, section 3cxx, iykyk πŸ’…


✨ SYNOPSIS ✨

#include <allocated_ptr.h>

πŸŽ€ Public Types πŸŽ€

  • using pointer = typename allocator_traits< _Alloc >::pointer β€” the allocator's pointer type, just vibing under an alias 🌈
  • using value_type = typename allocator_traits< _Alloc >::value_type β€” the allocator's value type, same energy ✨

🫢 Public Member Functions 🫢

  • __allocated_ptr (__allocated_ptr &&__gd) noexcept β€” transfer ownership of the owned pointer. move it, don't copy it, no cap πŸ”₯
  • template<typename _Ptr , typename _Req = _Require<is_same<_Ptr, value_type*>>> __allocated_ptr (_Alloc &__a, _Ptr __ptr) β€” convert __ptr to allocator's pointer type and take ownership of it πŸ¦‹
  • __allocated_ptr (_Alloc &__a, pointer __ptr) noexcept β€” take ownership of __ptr πŸ’–
  • ~__allocated_ptr () β€” deallocate the owned pointer. the era ends 😭
  • value_type * get () β€” get the address that the owned pointer refers to πŸ‘‘
  • __allocated_ptr & operator= (std::nullptr_t) noexcept β€” release ownership of the owned pointer. bye bestie, go be free 🧚

🌈 Detailed Description 🌈

template<typename _Alloc>
    struct std::__allocated_ptr< _Alloc >

"Non-standard RAII type for managing pointers obtained from allocators." periodt. that's the whole vibe. it holds your pointer, it cleans up after your pointer, it does the most so you don't have to πŸ’€βœ¨


πŸ’œ Constructor & Destructor Documentation πŸ’œ

template<typename _Alloc > std::__allocated_ptr< _Alloc >::__allocated_ptr (_Alloc & __a, pointer __ptr) [inline], [noexcept]

Take ownership of __ptr. simple as that, she's yours now 🫢

template<typename _Alloc > template<typename _Ptr , typename _Req = _Require<is_same<_Ptr, value_type*>>> std::__allocated_ptr< _Alloc >::__allocated_ptr (_Alloc & __a, _Ptr __ptr) [inline]

Convert __ptr to allocator's pointer type and take ownership of it. glow-up transformation fr fr πŸ¦‹βœ¨

template<typename _Alloc > std::__allocated_ptr< _Alloc >::__allocated_ptr (__allocated_ptr< _Alloc > && __gd) [inline], [noexcept]

Transfer ownership of the owned pointer. handoff, main character style πŸ‘‘

template<typename _Alloc > std::__allocated_ptr< _Alloc >::~__allocated_ptr () [inline]

Deallocate the owned pointer. she's done, she's resting πŸ’…

References std::allocator_traits< _Alloc >::deallocate().

⭐ Member Function Documentation ⭐

template<typename _Alloc > value_type * std::__allocated_ptr< _Alloc >::get () [inline]

Get the address that the owned pointer refers to. here's the address bestie, take it πŸŽ€

template<typename _Alloc > __allocated_ptr & std::__allocated_ptr< _Alloc >::operator= (std::nullptr_t) [inline], [noexcept]

Release ownership of the owned pointer. not me setting it to nullptr and walking away πŸ™ˆ


🌸 Author 🌸

Generated automatically by Doxygen for libstdc++ from the source code. the robots did this one, not me πŸ€–πŸ’–


okay that's the whole page bestie!! every option, every signature, every reference β€” all of it, untouched, just ✨glowified✨. this came out of libstdc++ for std::__allocated_ptr< _Alloc >, section 3cxx, and yeah the footer's the same as the header because manpages are like that πŸ’€ love u, go deallocate responsibly πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from