Fixed non-const lvalue reference to type 'std::from_chars_result' cannot bind to a temporary of type 'std::from_chars_result'

This commit is contained in:
ergo720 2021-10-12 19:02:42 +02:00
parent ca5a1aaa71
commit 51c3f37596
1 changed files with 1 additions and 1 deletions

View File

@ -109,7 +109,7 @@ std::string PortUserFormat(std::string_view port)
void PortStr2Int(std::string_view port, int *port_num, int *slot)
{
*slot = PORT_INVALID;
auto &ret = std::from_chars(port.data(), port.data() + port.size(), *port_num);
auto ret = std::from_chars(port.data(), port.data() + port.size(), *port_num);
assert(ret.ec != std::errc::invalid_argument);
if (ret.ptr != port.data() + port.size()) {
++ret.ptr;