Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::exception::what

      From cppreference.com
      <cpp‎ |error‎ |exception
       
       
      Utilities library
       
      Diagnostics library
       
       
      virtualconstchar* what()constthrow();
      (until C++11)
      virtualconstchar* what()constnoexcept;
      (since C++11)
      (constexpr since C++26)

      Returns the explanatory string.

      [edit]Parameters

      (none)

      [edit]Return value

      Pointer to a null-terminated string with explanatory information. The pointer is guaranteed to be valid at least until the exception object from which it is obtained is destroyed, or until a non-const member function on the exception object is called.

      The returned string is encoded with the ordinary literal encoding during constant evaluation.

      (since C++26)

      [edit]Defect reports

      The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

      DRApplied toBehavior as publishedCorrect behavior
      LWG 108C++98it was unspecified when the returned pointer becomes invalidspecified
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/error/exception/what&oldid=177846"

      [8]ページ先頭

      ©2009-2025 Movatter.jp