WPILibC++ 2024.1.1-beta-4
wpi::FunctionPointerLikeTypeTraits< Alignment, FunctionPointerT > Struct Template Reference

Provide suitable custom traits struct for function pointers. More...

#include </home/runner/work/allwpilib/allwpilib/wpiutil/src/main/native/thirdparty/llvm/include/wpi/PointerLikeTypeTraits.h>

Static Public Member Functions

static void * getAsVoidPointer (FunctionPointerT P)
 
static FunctionPointerT getFromVoidPointer (void *P)
 

Static Public Attributes

static constexpr int NumLowBitsAvailable
 

Detailed Description

template<int Alignment, typename FunctionPointerT>
struct wpi::FunctionPointerLikeTypeTraits< Alignment, FunctionPointerT >

Provide suitable custom traits struct for function pointers.

Function pointers can't be directly given these traits as functions can't have their alignment computed with alignof and we need different casting.

To rely on higher alignment for a specialized use, you can provide a customized form of this template explicitly with higher alignment, and potentially use alignment attributes on functions to satisfy that.

Member Function Documentation

◆ getAsVoidPointer()

template<int Alignment, typename FunctionPointerT >
static void * wpi::FunctionPointerLikeTypeTraits< Alignment, FunctionPointerT >::getAsVoidPointer ( FunctionPointerT  P)
inlinestatic

◆ getFromVoidPointer()

template<int Alignment, typename FunctionPointerT >
static FunctionPointerT wpi::FunctionPointerLikeTypeTraits< Alignment, FunctionPointerT >::getFromVoidPointer ( void *  P)
inlinestatic

Member Data Documentation

◆ NumLowBitsAvailable

template<int Alignment, typename FunctionPointerT >
constexpr int wpi::FunctionPointerLikeTypeTraits< Alignment, FunctionPointerT >::NumLowBitsAvailable
staticconstexpr
Initial value:
=
detail::ConstantLog2<Alignment>::value

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