libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
gbl::PrimitiveCompatible< P, CRTP > Class Template Reference

Public Member Functions

constexpr const P * primitive_cast (void) const noexcept
 
constexpr operator P () const noexcept
 
constexpr P * operator& (void) noexcept
 
constexpr const P * operator& (void) const noexcept
 

Static Public Member Functions

template<typename T >
static constexpr std::enable_if_t< std::same_as< T, P >, P * > primitive_cast (CRTP *pDerived) noexcept
 

Detailed Description

template<typename P, typename CRTP>
class gbl::PrimitiveCompatible< P, CRTP >

Definition at line 28 of file gimbal_decls.hpp.

Member Function Documentation

◆ primitive_cast() [1/2]

template<typename P , typename CRTP >
template<typename T >
static constexpr std::enable_if_t< std::same_as< T, P >, P * > gbl::PrimitiveCompatible< P, CRTP >::primitive_cast ( CRTP *  pDerived)
inlinestaticconstexprnoexcept

Definition at line 36 of file gimbal_decls.hpp.

36{ return &*static_cast<ThisType*>(pDerived); }

◆ primitive_cast() [2/2]

template<typename P , typename CRTP >
constexpr const P * gbl::PrimitiveCompatible< P, CRTP >::primitive_cast ( void  ) const
inlineconstexprnoexcept

Definition at line 38 of file gimbal_decls.hpp.

38{ return reinterpret_cast<const P*>(derived()->getPrimitiveAddress()); }

◆ operator P()

template<typename P , typename CRTP >
constexpr gbl::PrimitiveCompatible< P, CRTP >::operator P ( ) const
inlineconstexprnoexcept

Definition at line 40 of file gimbal_decls.hpp.

40{ return static_cast<P>(derived()->getPrimitiveValue()); }

◆ operator&() [1/2]

template<typename P , typename CRTP >
constexpr P * gbl::PrimitiveCompatible< P, CRTP >::operator& ( void  )
inlineconstexprnoexcept

Definition at line 41 of file gimbal_decls.hpp.

41{ return static_cast<P*>(derived()->getPrimitiveAddress()); }

◆ operator&() [2/2]

template<typename P , typename CRTP >
constexpr const P * gbl::PrimitiveCompatible< P, CRTP >::operator& ( void  ) const
inlineconstexprnoexcept

Definition at line 42 of file gimbal_decls.hpp.

42{ return static_cast<const P*>(derived()->getPrimitiveAddress()); }

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