std::chrono::nonexistent_local_time
| ヘッダー <chrono> で定義 |
||
| class nonexistent_local_time; |
(C++20以降) | |
存在しない std::chrono::local_time を、std::chrono::choose(例えば choose::earliest や choose::latest)を指定せずに std::chrono::sys_time に変換しようとしたことを報告するために例外としてスローされるオブジェクトの型を定義します。
この例外は、std::chrono::time_zone::to_sys およびそれを呼び出す関数(std::chrono::local_time を引数に取る std::chrono::zoned_time のコンストラクタなど)によってスローされます。
継承図
目次 |
[編集] メンバ関数
| (コンストラクタ) |
例外オブジェクトを構築する (public member function) |
| operator= |
例外オブジェクトを置き換えます (public member function) |
| what |
説明文字列を返す (public member function) |
std::chrono::nonexistent_local_time::nonexistent_local_time
| template< class Duration > nonexistent_local_time( const std::chrono::local_time<Duration>& tp, |
(1) | (C++20以降) |
| nonexistent_local_time( const nonexistent_local_time& other ) noexcept; |
(2) | (C++20以降) |
例外オブジェクトを構築します。
os.str() によって生成されるものと同等です。std::ostringstream os; os << tp << " is in a gap between\n" << std::chrono::local_seconds(i.first.end.time_since_epoch()) + i.first.offset << ' ' << i.first.abbrev << " and\n" << std::chrono::local_seconds(i.second.begin.time_since_epoch()) + i.second.offset << ' ' << i.second.abbrev << " which are both equivalent to\n" << i.first.end << " UTC";
std::chrono::nonexistent_local_time を持つ場合、 std::strcmp(what(), other.what()) == 0 です。パラメータ
| tp | - | 変換が試みられた時刻点 |
| i | - | 変換試行の結果を記述する std::chrono::local_info |
| その他 | - | コピー元の別の nonexistent_local_time |
例外
std::bad_alloc をスローする可能性があります。
注釈
std::exception から派生した標準ライブラリクラスのコピーは例外をスローすることが許可されていないため、このメッセージは通常、内部的に別個に割り当てられた参照カウント文字列として格納されます。
std::chrono::nonexistent_locale_time::operator=
| nonexistent_locale_time& operator=( const nonexistent_locale_time& other ) noexcept; |
(C++20以降) | |
other の内容をこのオブジェクトに代入します。 *this と other が両方とも動的型 std::chrono::nonexistent_locale_time を持つ場合、代入後、 std::strcmp(what(), other.what()) == 0 です。
パラメータ
| その他 | - | 割り当てる別の例外オブジェクト |
戻り値
*this
std::chrono::nonexistent_locale_time::what
virtual const char* what() const noexcept; |
(C++20以降) | |
説明文字列を返します。
戻り値
説明情報を含む、実装定義のヌル終端文字列へのポインタ。この文字列は std::wstring として変換および表示するのに適しています。このポインタは、それが取得された例外オブジェクトが破棄されるか、例外オブジェクトの非 const メンバー関数(例:コピー代入演算子)が呼び出されるまで、少なくとも有効であることが保証されます。
|
返された文字列は、定数評価中に通常のリテラルエンコーディングでエンコードされます。 |
(C++26以降) |
注釈
実装は what() をオーバーライドすることが許可されていますが、必須ではありません。
std::runtime_error から継承
std::exception から継承
メンバ関数
| [virtual] |
例外オブジェクトを破棄する ( std::exception の仮想 public メンバー関数) |
| [virtual] |
説明文字列を返す ( std::exception の仮想 public メンバー関数) |
[編集] 関連項目
| (C++20) |
ローカル時刻が曖昧であることを報告するためにスローされる例外 (クラス) |