Don't declare a function void if it returns values. Fix template lookup. Always use correct C++ syntax. Add missing header.