ned14 / status-code

Proposed SG14 status_code for the C++ standard

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Additional move-constructor call in status_code.message()

Tradias opened this issue · comments

In MSVC the ternary operator in status_code.hpp:445

  string_ref message() const noexcept { return this->_domain ? string_ref(this->domain()._do_message(*this)) : string_ref("(empty)"); 

causes an additional call to the move-constructor (and therefore destructor) of string_ref. See https://godbolt.org/z/1vW4WY

Thanks for the bug report!