microfmt
Zero-allocation C++ formatting for constrained environments
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
microfmt::compat32_ptr< T > Class Template Reference

Value-type pointer storing a 32-bit address (for 64-bit hosts). More...

#include <compat32.hpp>

Public Types

using element_type = T
 Referenced element type.
 

Public Member Functions

constexpr compat32_ptr () noexcept
 Constructs a null pointer.
 
constexpr compat32_ptr (std::nullptr_t) noexcept
 Constructs a null pointer.
 
constexpr compat32_ptr (uint32_t addr) noexcept
 Constructs a pointer from a 32-bit address.
 
constexpr uint32_t raw_value () const noexcept
 Returns the raw 32-bit address.
 
constexpr uintptr_t to_uintptr () const noexcept
 Widens the address to a host pointer-size integer.
 
constexpr bool is_null () const noexcept
 Reports whether the pointer is null.
 
constexpr operator bool () const noexcept
 Reports whether the pointer is non-null.
 
constexpr bool operator== (const compat32_ptr &other) const noexcept
 Compares two pointers for equality.
 
constexpr bool operator!= (const compat32_ptr &other) const noexcept
 Compares two pointers for inequality.
 
constexpr bool operator== (std::nullptr_t) const noexcept
 Compares against null.
 
constexpr bool operator!= (std::nullptr_t) const noexcept
 Compares against null.
 

Detailed Description

template<typename T>
class microfmt::compat32_ptr< T >

Value-type pointer storing a 32-bit address (for 64-bit hosts).

Template Parameters
TReferenced object type.

Member Typedef Documentation

◆ element_type

template<typename T >
using microfmt::compat32_ptr< T >::element_type = T

Referenced element type.

Constructor & Destructor Documentation

◆ compat32_ptr() [1/3]

template<typename T >
constexpr microfmt::compat32_ptr< T >::compat32_ptr ( )
inlineconstexprnoexcept

Constructs a null pointer.

◆ compat32_ptr() [2/3]

template<typename T >
constexpr microfmt::compat32_ptr< T >::compat32_ptr ( std::nullptr_t  )
inlineexplicitconstexprnoexcept

Constructs a null pointer.

◆ compat32_ptr() [3/3]

template<typename T >
constexpr microfmt::compat32_ptr< T >::compat32_ptr ( uint32_t  addr)
inlineexplicitconstexprnoexcept

Constructs a pointer from a 32-bit address.

Member Function Documentation

◆ is_null()

template<typename T >
constexpr bool microfmt::compat32_ptr< T >::is_null ( ) const
inlineconstexprnoexcept

Reports whether the pointer is null.

Returns
true when the address is zero.

◆ operator bool()

template<typename T >
constexpr microfmt::compat32_ptr< T >::operator bool ( ) const
inlineexplicitconstexprnoexcept

Reports whether the pointer is non-null.

Returns
true when the address is non-zero.

◆ operator!=() [1/2]

template<typename T >
constexpr bool microfmt::compat32_ptr< T >::operator!= ( const compat32_ptr< T > &  other) const
inlineconstexprnoexcept

Compares two pointers for inequality.

◆ operator!=() [2/2]

template<typename T >
constexpr bool microfmt::compat32_ptr< T >::operator!= ( std::nullptr_t  ) const
inlineconstexprnoexcept

Compares against null.

◆ operator==() [1/2]

template<typename T >
constexpr bool microfmt::compat32_ptr< T >::operator== ( const compat32_ptr< T > &  other) const
inlineconstexprnoexcept

Compares two pointers for equality.

◆ operator==() [2/2]

template<typename T >
constexpr bool microfmt::compat32_ptr< T >::operator== ( std::nullptr_t  ) const
inlineconstexprnoexcept

Compares against null.

◆ raw_value()

template<typename T >
constexpr uint32_t microfmt::compat32_ptr< T >::raw_value ( ) const
inlineconstexprnoexcept

Returns the raw 32-bit address.

Returns
Stored address value.

◆ to_uintptr()

template<typename T >
constexpr uintptr_t microfmt::compat32_ptr< T >::to_uintptr ( ) const
inlineconstexprnoexcept

Widens the address to a host pointer-size integer.

Returns
Stored address as uintptr_t.

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