- chrono[meta header]
- std::chrono[meta namespace]
- duration[meta class]
- function[meta id-type]
- cpp11[meta cpp]
static constexpr duration zero(); // C++11
static constexpr duration zero() noexcept; // C++20
rep
の初期値から成るduration
を取得する
duration(
duration_values
<rep>::
zero
())
#include <iostream>
#include <chrono>
using std::chrono::duration;
using std::micro;
int main()
{
using microseconds = duration<int, micro>;
microseconds m = microseconds::zero();
std::cout << m.count() << std::endl;
}
- zero()[color ff0000]
- micro[link /reference/ratio/si_prefix.md]
- count()[link count.md]
0
- C++11
- GCC: 4.5.1 [mark verified], 4.6.1 [mark verified]
- Visual C++: 2012 [mark verified], 2013 [mark verified], 2015 [mark verified]