fix(config): Test type and not value

This commit is contained in:
Michael Carlberg 2016-10-19 10:06:29 +02:00
parent 94ded75756
commit 3c0cc72c55
1 changed files with 4 additions and 3 deletions

View File

@ -212,12 +212,13 @@ class config {
}
if (path.find("xrdb:") == 0) {
if (std::is_same<string, T>())
if (std::is_same<string, T>::value)
return boost::lexical_cast<T>(m_xrm.get_string(path.substr(5)));
else if (std::is_same<float, T>())
else if (std::is_same<float, T>::value)
return boost::lexical_cast<T>(m_xrm.get_float(path.substr(5)));
else if (std::is_same<int, T>())
else if (std::is_same<int, T>::value)
return boost::lexical_cast<T>(m_xrm.get_int(path.substr(5)));
return ref_val;
}
auto ref_path = build_path(ref_section, ref_key);