• Class / Function / Type

      std::
    • Header file

      <>
    • Other / All

    最終更新日時(UTC):
    が更新

    履歴 編集

    function
    <chrono>

    std::chrono::weekday::operator-=

    constexpr weekday& operator-=(const days& d) noexcept; // (1) C++20
    

    概要

    weekdayの値に対して減算の複合代入を行う。

    効果

    • (1) : *this = *this - d

    戻り値

    • (1) : *this

    例外

    投げない

    #include <cassert>
    #include <chrono>
    
    namespace chrono = std::chrono;
    
    int main()
    {
      chrono::weekday w = chrono::Monday;
    
      w -= chrono::days{3};
      assert(w == chrono::Friday);
    }
    

    出力

    バージョン

    言語

    • C++20

    処理系