changed template parameter in c++ snippet from float to int