No description provided.
Added assignment operators to newDatetimeVector and newDateVector. Fi…
…xed a small bug in their copy construtors.
Oops, left the new ones turned on.
Merge remote-tracking branch 'upstream/master' into feature/new-datet…
Might be nice to have a plugin to turn this functionality on as well.
What are you talking about, exactly? Is it this:
edd@max:~/git/rcpp(master)$ git diff
diff --git a/inst/include/Rcpp.h b/inst/include/Rcpp.h
index d365958..fbae1c1 100644
@@ -57,6 +57,7 @@
// #define RCPP_NEW_DATE_DATETIME_VECTORS 1
+#define RCPP_NEW_DATE_DATETIME_VECTORS 1
That is a single -D... argument to the compiler in ~/.R/Makevars, as an env.var or, like here, as edit. Do we really need a plugin for that?
I just think it makes it cleaner than relying on the developer for it. Then we can also change how it's implemented behind the scenes (if needed) and change the plugin accordingly to get the right build configuration.
Very nice that you added unit tests too.
Calling for reviews or thumbs up/down ... might be nice to get this in before I run a round of tests tomorrow.
@kevinushey @thirdwing @nathan-russell @jjallaire
LGTM, although I'm not as familiar with datetime handling (+ the associated traps inherent) with R.
There is not much too it, but it looks super-confusing. POSIXct is just out friend time_t, generalised by BDR et al to be a 53 digit double (hence with about microsec precision from the remaining bits). It generally stores in UTC as one should and uses a TZ attribute for offset (when formatting for humans, say).
I didn't understand what attributes did eight or nine years ago so the first iteration of these were std::vector<> containers which is very very un-SEXP. So now we use NumericVector with a class attribute, and the world is a better place. There aren't too many packages using these types, and some I am involved with so the transition should be easy. (And POSXlt, as you know, is just lists of struct tm components presenting the same content.)
And what Dan did here was filling gaps I had left as I had, ahem, forgotten that constructors etc don't inherit. So we needed a bit of additional stuff which we now have.