diff --git a/single_include/toml.hpp b/single_include/toml.hpp index 8714093a..d89cb1c4 100644 --- a/single_include/toml.hpp +++ b/single_include/toml.hpp @@ -9258,16 +9258,14 @@ find_or(const basic_value& v, const K& ky, T opt) namespace detail { -template -T& last_one(T& arg) -{ - return arg; -} -template -auto last_one(T1&, T2& arg, Ts& ... args) -> decltype(last_one(arg, args...)) + +template +auto last_one(Ts&&... args) + -> decltype(std::get(std::forward_as_tuple(std::forward(args)...))) { - return last_one(arg, args...); + return std::get(std::forward_as_tuple(std::forward(args)...)); } + } // detail template