Blender V5.0
blender::fixed_width_int::UIntF< T, S > Struct Template Reference

#include <BLI_fixed_width_int.hh>

Public Member Functions

 UIntF ()=default
 UIntF (uint64_t value)
 UIntF (StringRefNull str, int base=10)
 operator uint64_t () const
 operator double () const
 operator float () const

Public Attributes

std::array< T, S > v

Detailed Description

template<typename T, int S>
struct blender::fixed_width_int::UIntF< T, S >

An unsigned fixed width integer.

For some algorithms, the largest cross platform integer type (uint64_t) is not large enough. Then one has the choice to use some big-integer implementation like the one from GMP or one can use fixed-width-integers as implemented here.

Internally, this type combines multiple smaller integers into a bigger integer.

Definition at line 27 of file BLI_fixed_width_int.hh.

Constructor & Destructor Documentation

◆ UIntF() [1/3]

template<typename T, int S>
blender::fixed_width_int::UIntF< T, S >::UIntF ( )
default

Allow default construction. Note that the value is not initialized in this case.

Referenced by operator double(), operator float(), and operator uint64_t().

◆ UIntF() [2/3]

template<typename T, int S>
blender::fixed_width_int::UIntF< T, S >::UIntF ( uint64_t value)
inlineexplicit

Construct from a specific integer.

Definition at line 169 of file BLI_fixed_width_int.hh.

References i, T, and v.

◆ UIntF() [3/3]

template<typename T, int S>
blender::fixed_width_int::UIntF< T, S >::UIntF ( StringRefNull str,
int base = 10 )
explicit

Construct from a string.

Member Function Documentation

◆ operator double()

template<typename T, int S>
blender::fixed_width_int::UIntF< T, S >::operator double ( ) const
inlineexplicit

Convert to floating point. This may lose precision.

Definition at line 222 of file BLI_fixed_width_int.hh.

References i, ldexp, result, T, UIntF(), and v.

◆ operator float()

template<typename T, int S>
blender::fixed_width_int::UIntF< T, S >::operator float ( ) const
inlineexplicit

Definition at line 235 of file BLI_fixed_width_int.hh.

References float, and UIntF().

◆ operator uint64_t()

template<typename T, int S>
blender::fixed_width_int::UIntF< T, S >::operator uint64_t ( ) const
inlineexplicit

Convert to a normal integer. Note that this may lose digits.

Definition at line 210 of file BLI_fixed_width_int.hh.

References i, result, T, UIntF(), and v.

Member Data Documentation

◆ v


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