Euphoria
default_interpolate.h
Go to the documentation of this file.
1 #pragma once
2 
3 namespace eu
4 {
5 
6 // todo(Gustav): change to a function instead of a struct
7 
8 template<typename T>
10 {
11 };
12 
13 template<typename T>
14 T default_interpolate(const T& from, float t, const T& to)
15 {
16  return InterpolateDefault<T>::interpolate(from, t, to);
17 }
18 
19 #define DEFAULT_INTERPOLATE(TYPE, FUNCTION) template<> struct InterpolateDefault<TYPE> {\
20  static TYPE interpolate(const TYPE& from, float v, const TYPE& to) { return FUNCTION(from, v, to); }\
21 }
22 
23 
24 }
Definition: assert.h:90
T default_interpolate(const T &from, float t, const T &to)