std::chrono::operator<<(std::chrono::weekday_indexed) (3) - Linux Man Pages

std::chrono::operator<<(std::chrono::weekday_indexed): std::chrono::operator<<(std::chrono::weekday_indexed)

NAME

std::chrono::operator<<(std::chrono::weekday_indexed) - std::chrono::operator<<(std::chrono::weekday_indexed)

Synopsis


template <class CharT, class Traits>
std::basic_ostream<CharT, Traits>& (since C++20)
operator<<(std::basic_ostream<CharT, Traits>& os, const std::chrono::weekday_indexed& wdi);


Outputs a textual representation of wdi into the stream os, as if by:


  os << wdi.weekday() << '[' << wdi.index();
  if(wdi.index() >=1 && wdi.index <= 5) {
      os << ']';
  }
  else {
      os << " is not a valid index]";
  }

Return value


os.

Notes


This operator<< is primarily intended for debugging use. When used with non-default stream flags, the output may be surprising:


  auto wdi = std::chrono::Sunday[1];
  std::cout.width(10);
  std::cout.fill('-');
  std::cout << std::left << wdi; // may output "Sun-------[1]"