Basic linear interpolator class in C++