sanisizer
Sanitize sizes to avoid integer overflow
Loading...
Searching...
No Matches
sanisizer::Constant< Integer_, value_ > Struct Template Reference

Integer constant. More...

#include <Constant.hpp>

Public Types

typedef Integer_ Integer
 

Static Public Attributes

static constexpr Integer_ value = value_
 

Detailed Description

template<typename Integer_, Integer_ value_>
struct sanisizer::Constant< Integer_, value_ >

Integer constant.

Template Parameters
Integer_Type of the integer.
value_Value of the integer, known at compile time. This should be non-negative.

The aim is to provide a mechanism to detect a compile-time constant, allowing developers to reorganize their calculations to push more work to compile time. This enables some optimizations in functions like sum() and product().

Member Typedef Documentation

◆ Integer

template<typename Integer_ , Integer_ value_>
Integer_ sanisizer::Constant< Integer_, value_ >::Integer

Type of the integer.

Member Data Documentation

◆ value

template<typename Integer_ , Integer_ value_>
Integer_ sanisizer::Constant< Integer_, value_ >::value = value_
staticconstexpr

Value of the constant integer, known at compile time. This will be non-negative.


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