Sample to a function template