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:
parent
ca5a1aaa71
commit
51c3f37596
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue