WPILibC++  2020.3.2-60-g3011ebe
wpi::FunctionPointerLikeTypeTraits< Alignment, FunctionPointerT > Struct Template Reference

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

#include <PointerLikeTypeTraits.h>

Public Types

enum  { NumLowBitsAvailable = detail::ConstantLog2<Alignment>::value }
 

Static Public Member Functions

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

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.


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