- chrono[meta header]
- std::chrono[meta namespace]
- function[meta id-type]
- cpp20[meta cpp]
namespace std::chrono {
constexpr bool
operator>=(const leap_second& x,
const leap_second& y) noexcept; // (1) C++20 (operator<=>により使用可能)
template <class Duration>
constexpr bool
operator>=(const leap_second& x,
const sys_time<Duration>& y) noexcept; // (2) C++20
template <class Duration>
constexpr bool
operator>=(const sys_time<Duration>& x,
const leap_second& y) noexcept; // (3) C++20
}
- sys_time[link /reference/chrono/sys_time.md]
左辺が右辺以上の比較を行う。
- (1) :
leap_second
オブジェクト同士において、左辺が右辺以上かの比較を行う - (2) :
leap_second
オブジェクトとsys_time
オブジェクトにおいて、左辺が右辺以上かの比較を行う - (3) :
sys_time
オブジェクトとleap_second
オブジェクトにおいて、左辺が右辺以上かの比較を行う
return !(x < y);
投げない
#include <iostream>
#include <chrono>
namespace chrono = std::chrono;
using namespace std::chrono_literals;
int main()
{
// 2000年1月1日以降にうるう秒が挿入された日を列挙する
for (const chrono::leap_second& date : chrono::get_tzdb().leap_seconds) {
if (date >= 2000y/1/1)
std::cout << date.date() << std::endl;
}
}
- chrono::get_tzdb()[link /reference/chrono/get_tzdb.md]
- 2000y[link /reference/chrono/year/op_y.md]
- date()[link date.md]
2006-01-01 00:00:00
2009-01-01 00:00:00
2012-07-01 00:00:00
2015-07-01 00:00:00
2017-01-01 00:00:00
- C++20
- Clang: 9.0 [mark noimpl]
- GCC: 9.2 [mark noimpl]
- Visual C++: 2019 Update 3 [mark noimpl]