FE 0.15.0
A C++23 toolkit for writing compiler/interpreter frontends.
Loading...
Searching...
No Matches
fe::Arena::Ref< T > Class Template Reference

A non-owning pointer into an Arena. More...

#include <fe/arena.h>

Public Member Functions

constexpr Ref () noexcept=default
constexpr Ref (std::nullptr_t) noexcept
constexpr Ref (T *ptr) noexcept
template<class U>
requires std::convertible_to<U*, T*>
constexpr Ref (Ref< U > ref) noexcept
constexpr T * get () const noexcept
constexpr T * operator-> () const noexcept
constexpr T & operator* () const noexcept
constexpr operator bool () const noexcept
constexpr bool operator== (const Ref &) const noexcept=default

Detailed Description

template<class T>
class fe::Arena::Ref< T >

A non-owning pointer into an Arena.

The Arena outlives it and releases everything at once, so nothing is ever destroyed through it - unlike Arena::Ptr, which at least runs the destructor.

Definition at line 94 of file arena.h.

Constructor & Destructor Documentation

◆ Ref() [1/4]

template<class T>
fe::Arena::Ref< T >::Ref ( )
constexprdefaultnoexcept

Referenced by operator==(), Ref(), Ref(), and fe::Arena::ref().

◆ Ref() [2/4]

template<class T>
fe::Arena::Ref< T >::Ref ( std::nullptr_t )
inlineconstexprnoexcept

Definition at line 97 of file arena.h.

References Ref().

◆ Ref() [3/4]

template<class T>
fe::Arena::Ref< T >::Ref ( T * ptr)
inlineexplicitconstexprnoexcept

Definition at line 98 of file arena.h.

◆ Ref() [4/4]

template<class T>
template<class U>
requires std::convertible_to<U*, T*>
fe::Arena::Ref< T >::Ref ( Ref< U > ref)
inlineconstexprnoexcept

Definition at line 101 of file arena.h.

References Ref(), and fe::Arena::ref().

Member Function Documentation

◆ get()

template<class T>
T * fe::Arena::Ref< T >::get ( ) const
inlineconstexprnoexcept

Definition at line 104 of file arena.h.

◆ operator bool()

template<class T>
fe::Arena::Ref< T >::operator bool ( ) const
inlineexplicitconstexprnoexcept

Definition at line 107 of file arena.h.

◆ operator*()

template<class T>
T & fe::Arena::Ref< T >::operator* ( ) const
inlineconstexprnoexcept

Definition at line 106 of file arena.h.

◆ operator->()

template<class T>
T * fe::Arena::Ref< T >::operator-> ( ) const
inlineconstexprnoexcept

Definition at line 105 of file arena.h.

◆ operator==()

template<class T>
bool fe::Arena::Ref< T >::operator== ( const Ref< T > & ) const
constexprdefaultnoexcept

References Ref().


The documentation for this class was generated from the following file: