Skip to content

Commit 85592a8

Browse files
committed
Merge remote-tracking branch 'upstream/master' into feature/no-sugar-tonight-in-my-coffee
2 parents 3057789 + c47efce commit 85592a8

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
lines changed

ChangeLog

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,28 @@
66
of RNGScope
77
* inst/include/Rcpp/vector/Matrix.h: Protected Matrix op Scalar
88
definitions with #ifndef RCPP_NO_SUGAR
9+
2016-11-10 Dirk Eddelbuettel <[email protected]>
10+
11+
* inst/include/Rcpp/date_datetime/newDateVector.h: Added constructor
12+
using VectorBase<>
13+
14+
2016-01-05 Daniel C. Dillon <[email protected]>
15+
16+
* inst/include/Rcpp/date_datetime/newDatetimeVector.h: Added constructor
17+
to instantiate newDatetimeVector from VectorBase.
918

1019
2016-11-04 Nathan Russell <[email protected]>
1120

12-
* inst/include/Rcpp/macros/dispatch.h: Modify variadic macros
21+
* inst/include/Rcpp/macros/dispatch.h: Modify variadic macros
1322
to not use GNU extensions
1423
* DESCRIPTION: roll minor version
1524

1625
2016-11-03 Nathan Russell <[email protected]>
1726

18-
* inst/include/Rcpp/hash/IndexHash.h: Add casts to eliminate
27+
* inst/include/Rcpp/hash/IndexHash.h: Add casts to eliminate
1928
signed / unsigned comparison warning
2029
* inst/include/Rcpp/hash/SelfHash.h: Idem
21-
* inst/unitTests/cpp/sugar.cpp: Added unit tests for sugar function
30+
* inst/unitTests/cpp/sugar.cpp: Added unit tests for sugar function
2231
unique()
2332
* inst/unitTests/runit.sugar.R: Idem
2433

inst/NEWS.Rd

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@
3333
\itemize{
3434
\item The \code{DateVector} and \code{DatetimeVector} classes were renamed
3535
with a prefix \code{old}; they are currently \code{typedef}'ed to the
36-
existing name (\ghpr{557})
36+
existing name (\ghpr{557}, also \ghpr{577})
3737
\item New variants \code{newDateVector} and \code{newDatetimeVector} were
38-
added based on \code{NumericVector} (also (\ghpr{557})
38+
added based on \code{NumericVector} (also \ghpr{557}, \ghpr{577})
3939
\item By defining \code{RCPP_NEW_DATE_DATETIME_VECTORS} the new classes
4040
can activated. We intend to make the new classes the default no sooner
4141
than twelve months from this release.
42-
\item The \code{capabilities()} function can also be tested for this feature
42+
\item The \code{capabilities()} function can also be used for presence of
43+
this feature
4344
}
4445
}
4546
}

inst/include/Rcpp/date_datetime/newDateVector.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ namespace Rcpp {
2828

2929
class newDateVector : public NumericVector {
3030
public:
31+
template <int RTYPE, bool NA, typename VEC>
32+
newDateVector(const VectorBase<RTYPE,NA,VEC>& vec) : NumericVector(vec) {}
33+
3134
newDateVector(SEXP vec) : NumericVector(vec) { setClass(); }
3235
newDateVector(int n) : NumericVector(n) { setClass(); }
3336

inst/include/Rcpp/date_datetime/newDatetimeVector.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,15 @@ namespace Rcpp {
2828

2929
class newDatetimeVector : public NumericVector {
3030
public:
31+
template <int RTYPE, bool NA, typename VEC>
32+
newDatetimeVector(const VectorBase<RTYPE,NA,VEC>& other) :
33+
NumericVector(other) {}
34+
3135
newDatetimeVector(SEXP vec, const char* tz = "") :
3236
NumericVector(vec) {
3337
setClass(tz);
3438
}
39+
3540
newDatetimeVector(int n, const char* tz = "") :
3641
NumericVector(n) {
3742
setClass(tz);

0 commit comments

Comments
 (0)