std::chrono::month::operator+=, std::chrono::month::operator-=
提供: cppreference.com
<tbody>
</tbody>
constexpr std::chrono::month& operator+=(const std::chrono::months& m) noexcept; |
(1) | (C++20以上) |
constexpr std::chrono::month& operator+=(const std::chrono::months& m) noexcept; |
(2) | (C++20以上) |
月の値に m.count() を加算または減算し、結果を12で割った剰余を取って範囲 [1, 12] の整数に縮小します。
1)
*this = *this + m; を行います。2)
*this = *this - m; を行います。戻り値
変更後のこの month を指す参照。
ノート
演算中にオーバーフローが発生しなければ、これらの関数の呼び出しの後、 ok() は必ず true になります。
例
| This section is incomplete Reason: no example |
関連項目
| 月をインクリメントまたはデクリメントします (パブリックメンバ関数) | |
month に対する算術演算を行います (関数) |