Skip to content

Latest commit

 

History

History
55 lines (42 loc) · 1.2 KB

zero.md

File metadata and controls

55 lines (42 loc) · 1.2 KB

zero

  • 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]

参照