Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::chrono::operator<<(std::chrono::month)

      From cppreference.com
      <cpp‎ |chrono‎ |month
       
       
      Date and time library
       
       
      Defined in header<chrono>
      template<class CharT,class Traits>

      std::basic_ostream<CharT, Traits>&

          operator<<(std::basic_ostream<CharT, Traits>& os,conststd::chrono::month& m);
      (since C++20)

      If!m.ok(), insertsunsigned(m) followed by" is not a valid month" toos. Otherwise, forms astd::basic_string<CharT>s consisting of the abbreviated month name for the month represented bym, determined using the locale associated withos, and insertss intoos.

      Equivalent to

      return os<<(m.ok()?
         std::format(os.getloc(), STATICALLY_WIDEN<CharT>("{:L%b}"), m):
         std::format(os.getloc(), STATICALLY_WIDEN<CharT>("{} is not a valid month"),unsigned(m)));

      whereSTATICALLY_WIDEN<CharT>("...") is"..." ifCharT ischar, andL"..." ifCharT iswchar_t.

      Contents

      [edit]Return value

      os

      [edit]Notes

      Thisoperator<< is primarily intended for debugging use. For control over formatting, usestd::format.

      [edit]Defect reports

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

      DRApplied toBehavior as publishedCorrect behavior
      P2372R3C++20the given locale was used by defaultL is needed to use the given locale

      [edit]See also

      (C++20)
      stores formatted representation of the arguments in a new string
      (function template)[edit]
      formatting support formonth
      (class template specialization)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/chrono/month/operator_ltlt&oldid=161607"

      [8]ページ先頭

      ©2009-2026 Movatter.jp