GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::chrono::weekday_indexed(3) C++ Standard Libary std::chrono::weekday_indexed(3)

std::chrono::weekday_indexed - std::chrono::weekday_indexed


Defined in header <chrono>
class weekday_indexed; (since C++20)


The class weekday_indexed combines a weekday, representing a day of the week in the
Gregorian calendar, with a small index n in the range [1, 5]. It represents the
first, second, third, fourth, or fifth weekday of some month.


weekday_indexed is a TriviallyCopyable StandardLayoutType.


constructor constructs a weekday_indexed
(public member function)
weekday access the stored weekday
(public member function)
index access the stored index
(public member function)
ok checks if the weekday and index are both valid
(public member function)


Nonmember functions


operator== compares two weekday_indexed values
(C++20) (function)
operator<< outputs a weekday_indexed into a stream
(C++20) (function template)


specialization of std::formatter that
std::formatter<std::chrono::weekday_indexed> formats a weekday_indexed according to
(C++20) the provided format
(class template specialization)

// Run this code


#include <iostream>
#include <chrono>


int main()
{
using namespace std::chrono;


constexpr weekday_indexed wi = Friday[2];


// Indexed weekday can be used at any place where chrono::day can be used:
constexpr year_month_weekday ymwd = 2021y / August / wi;
static_assert( ymwd == August / wi / 2021y and
ymwd == wi / August / 2021y );
// std::cout << ymwd << '\n';


constexpr year_month_day ymd{ymwd}; // a conversion
static_assert(ymd == 2021y / 8 / 13);
// std::cout << ymd << '\n';
}


2021/Aug/Fri[2]
2021-08-13

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.