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::operator[](3) C++ Standard Libary std::chrono::weekday::operator[](3)

std::chrono::weekday::operator[] - std::chrono::weekday::operator[]


constexpr std::chrono::weekday_indexed operator[](unsigned index) (1) (since C++20)
const noexcept;
constexpr std::chrono::weekday_last (2) (since C++20)
operator[](std::chrono::last_spec) const noexcept;


1) Constructs a weekday_indexed from *this and index. The result represents the
index-th weekday in some yet-to-be-specified month. If index is not in the range [0,
7] or if !ok() the values held in the result is unspecified.
2) Constructs a weekday_last from *this. The result represents the last weekday in
some yet-to-be-specified month.


1) std::chrono::weekday_indexed(*this, index)
2) std::chrono::weekday_last(*this)

// Run this code


#include <chrono>
#include <iostream>
using namespace std::chrono;


int main()
{
constexpr auto second_tuesday_in_October_2019 =
year_month_day{ Tuesday[2] / October / 2019y };


constexpr auto last_tuesday_in_October_2019 =
year_month_day { Tuesday[last] / October / 2019y };


std::cout << second_tuesday_in_October_2019 << '\n'
<< last_tuesday_in_October_2019 << '\n';
}


2019-10-08
2019-10-29

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.