MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / operator+

Function operator+

inst/include/Rcpp/date_datetime/Date.h:156–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154 }
155
156 inline Date operator+(const Date &date, int offset) {
157 Date newdate(date.m_d);
158 newdate.m_d += offset;
159 time_t t = static_cast<time_t>(24*60*60 * newdate.m_d); // days since epoch to seconds since epo
160 newdate.m_tm = *gmtime_(&t);
161 return newdate;
162 }
163
164 inline double operator-( const Date& d1, const Date& d2) { return d1.m_d - d2.m_d; }
165 inline bool operator<( const Date &d1, const Date& d2) { return d1.m_d < d2.m_d; }

Callers

nothing calls this directly

Calls 1

gmtime_Function · 0.50

Tested by

no test coverage detected