openMSX

A constexpr power_of_two struct for power of two numbers, with compact storage and builtin value correctness assertion. More...
#include <power_of_two.hh>
Public Member Functions  
constexpr  power_of_two (T size) 
constexpr  operator T () const 
Public Attributes  
uint8_t  exponent = 0 
A constexpr power_of_two struct for power of two numbers, with compact storage and builtin value correctness assertion.
Additionally, the compiler optimises multiplication / division / modulo operations to bit shifts.
Definition at line 18 of file power_of_two.hh.

inlineconstexpr 
Definition at line 19 of file power_of_two.hh.

inlineconstexpr 
Definition at line 25 of file power_of_two.hh.
References openmsx::power_of_two< T >::exponent.
uint8_t openmsx::power_of_two< T >::exponent = 0 
Definition at line 30 of file power_of_two.hh.
Referenced by openmsx::power_of_two< T >::operator T().