pass by reference

This commit is contained in:
Erik Frojdh
2019-10-01 14:31:00 +02:00
parent b4f3c0586f
commit 5de5884341
2 changed files with 5 additions and 5 deletions

View File

@ -159,13 +159,14 @@ T StringTo(const std::string &t, const std::string &unit) {
}
}
template <typename T> T StringTo(std::string t) {
auto unit = RemoveUnit(t);
return StringTo<T>(t, unit);
template <typename T> T StringTo(const std::string& t) {
std::string tmp{t};
auto unit = RemoveUnit(tmp);
return StringTo<T>(tmp, unit);
}
template <>
inline slsDetectorDefs::detectorType StringTo(std::string s){
inline slsDetectorDefs::detectorType StringTo(const std::string& s){
return slsDetectorDefs::detectorTypeToEnum(s);
}