MIRA
Public Types | List of all members
TPower< base, exponent > Struct Template Reference

Computes the power base^exponent at compile time. More...

#include <math/Power.h>

Public Types

enum  { value = TPower<base,exponent-1>::value * base }
 

Detailed Description

template<int base, int exponent>
struct mira::TPower< base, exponent >

Computes the power base^exponent at compile time.

The computation at compile time allows to use the value as constant in other expressions (e.g. array sizes, etc).

Usage:
cout << TPower<2,8>::value << endl; // prints 256

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
value 

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