最終更新日時(UTC):
が更新

履歴 編集

function
<chrono>

std::chrono::duration::operator+(C++11)

constexpr common_type_t<duration> operator+() const;

概要

正の符号。

なにもせず、*thisをそのまま返す。

戻り値

common_type_t<duration>(*this)

#include <iostream>
#include <chrono>

using std::chrono::duration;
using std::nano;

int main()
{
  duration<int, nano> d1(2);

  duration<int, nano> d2 = +d1;

  std::cout << d1.count() << std::endl;
  std::cout << d2.count() << std::endl;
}

出力

2
2

バージョン

言語

  • C++11

処理系

参照