- chrono[meta header]
- std::chrono[meta namespace]
- duration[meta class]
- function[meta id-type]
- cpp11[meta cpp]
duration& operator+=(const duration& d); // C++11
constexpr duration& operator+=(const duration& d); // C++17
現在の値に、他のduration
の値を足す
rep_ += d.
count
()
*this
#include <iostream>
#include <chrono>
using std::chrono::duration;
using std::nano; using std::micro;
int main()
{
duration<int, nano> d1(2);
duration<int, micro> d2(3);
d1 += d2;
std::cout << d1.count() << std::endl;
}
- nano[link /reference/ratio/si_prefix.md]
- micro[link /reference/ratio/si_prefix.md]
- count()[link count.md]
3002
- C++11
- GCC: 4.5.1 [mark verified], 4.6.1 [mark verified]
- Visual C++: 2012 [mark verified], 2013 [mark verified], 2015 [mark verified]