diff --git a/toml/utility.hpp b/toml/utility.hpp index b6414e7..73ae26e 100644 --- a/toml/utility.hpp +++ b/toml/utility.hpp @@ -76,10 +76,10 @@ std::string concat_to_string(Ts&& ... args) return detail::concat_to_string_impl(oss, std::forward(args) ...); } -template -T from_string(const std::string& str, U&& opt) +template +T from_string(const std::string& str, T opt) { - T v(static_cast(std::forward(opt))); + T v(opt); std::istringstream iss(str); iss >> v; return v;