Loading...
Searching...
No Matches
EsfFixedSizePolymorphicHolder< Base, BufferSize >::Compatibility Struct Reference

Checks if instances of Derived can be stored in this holder. More...

#include <fixedSizePolymorphicHolder.h>

Static Public Member Functions

template<class Derived >
static bool HasBaseAtSameAddress (const Derived &derived)
 Verifies that a Derived instance has the same address as its Base.
 

Static Public Attributes

template<class Derived >
static constexpr bool FITS_IN_BUFFER = sizeof(Derived) <= BufferSize
 
template<class Derived >
static constexpr bool DERIVES_FROM_BASE
 
template<class Derived >
static constexpr bool HAS_ALIGNMENT
 

Detailed Description

template<class Base, size_t BufferSize = sizeof(Base)>
struct EsfFixedSizePolymorphicHolder< Base, BufferSize >::Compatibility

Checks if instances of Derived can be stored in this holder.

If any member of this class is false, then instances of Derived cannot be stored in this holder. These checks are made public for testing.

Definition at line 190 of file fixedSizePolymorphicHolder.h.

Member Function Documentation

◆ HasBaseAtSameAddress()

bool HasBaseAtSameAddress ( const Derived &  derived)
static

Verifies that a Derived instance has the same address as its Base.

This check would fail for certain cases of multiple-inheritance. C++ does not currently allow checking this at compile-time, so this check can only happen at runtime.

Definition at line 267 of file fixedSizePolymorphicHolder.h.

Member Data Documentation

◆ DERIVES_FROM_BASE

constexpr bool DERIVES_FROM_BASE
staticconstexpr
Initial value:
=
std::is_base_of_v<Base, Derived>

Definition at line 196 of file fixedSizePolymorphicHolder.h.

◆ FITS_IN_BUFFER

constexpr bool FITS_IN_BUFFER = sizeof(Derived) <= BufferSize
staticconstexpr

Definition at line 193 of file fixedSizePolymorphicHolder.h.

◆ HAS_ALIGNMENT

constexpr bool HAS_ALIGNMENT
staticconstexpr
Initial value:
=
alignof(Derived) == _REQUIRED_ALIGNMENT

Definition at line 200 of file fixedSizePolymorphicHolder.h.


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