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

Function operator+

inst/include/Rcpp/date_datetime/Datetime.h:138–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136 template<> SEXP wrap_extra_steps<Rcpp::Datetime>(SEXP x);
137
138 inline Datetime operator+(const Datetime &datetime, double offset) {
139 Datetime newdt(datetime.m_dt);
140 newdt.m_dt += offset;
141 double dt = std::floor(newdt.m_dt);
142 time_t t = static_cast<time_t>(dt);
143 newdt.m_tm = *gmtime_(&t);
144 newdt.m_us = static_cast<int>(::Rf_fround( (newdt.m_dt - dt) * 1.0e6, 0.0));
145 return newdt;
146 }
147
148 inline Datetime operator+(const Datetime &datetime, int offset) {
149 Datetime newdt(datetime.m_dt);

Callers

nothing calls this directly

Calls 1

gmtime_Function · 0.50

Tested by

no test coverage detected