vhirtham / GDL

Game Development Library
2 stars 0 forks source link

Template power function for integer exponents #19

Closed vhirtham closed 6 years ago

vhirtham commented 6 years ago

Create a template function like this

template <int _exp, typename _type>
constexpr inline _type Pow(_type value)

which basically rewrites

Pow<3>(3.f);

to

value = 3.f;
value * value * value;
vhirtham commented 6 years ago

Implemented in commit 9784a6aa0b85f6b45d203ada23eabe23591f796