Unline C# and Java generics, C++ templates can be specialized. Testing types the way you are doing is strongly discouraged.
If you used specialization, you wouldn't be having this problem, as it's related to conversions as BartoszKP commented.
template<typename T>
T& get(const std::string &name);
and outside the class, but still inside the header:
template<>
int& ClassName::get<int>(const std::string &name) { return ints[name]; }
template<>
float& ClassName::get<float>(const std::string &name) { return floats[name]; }