You don't need a wrapper class for this.  Once you created the spline object as in the original code, just call

    f.enableExtrapolation();

to allow out-of-range values. (You'll have to remove the `const` from the variable declaration, though).
The same goes for all the instances below.