Skip to content

Commit 45cbf37

Browse files
authored
Merge pull request #581 from RcppCore/feature/newdate-ctor
also add VectorBase ctor to newDatevector
2 parents 2aeb676 + dea83f0 commit 45cbf37

File tree

4 files changed

+23
-9
lines changed

4 files changed

+23
-9
lines changed

ChangeLog

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
1+
2016-11-10 Dirk Eddelbuettel <[email protected]>
2+
3+
* inst/include/Rcpp/date_datetime/newDateVector.h: Added constructor
4+
using VectorBase<>
5+
6+
2016-01-05 Daniel C. Dillon <[email protected]>
7+
8+
* inst/include/Rcpp/date_datetime/newDatetimeVector.h: Added constructor
9+
to instantiate newDatetimeVector from VectorBase.
10+
111
2016-11-04 Nathan Russell <[email protected]>
212

3-
* inst/include/Rcpp/macros/dispatch.h: Modify variadic macros
13+
* inst/include/Rcpp/macros/dispatch.h: Modify variadic macros
414
to not use GNU extensions
515
* DESCRIPTION: roll minor version
616

717
2016-11-03 Nathan Russell <[email protected]>
818

9-
* inst/include/Rcpp/hash/IndexHash.h: Add casts to eliminate
19+
* inst/include/Rcpp/hash/IndexHash.h: Add casts to eliminate
1020
signed / unsigned comparison warning
1121
* inst/include/Rcpp/hash/SelfHash.h: Idem
12-
* inst/unitTests/cpp/sugar.cpp: Added unit tests for sugar function
22+
* inst/unitTests/cpp/sugar.cpp: Added unit tests for sugar function
1323
unique()
1424
* inst/unitTests/runit.sugar.R: Idem
1525

inst/NEWS.Rd

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

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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ namespace Rcpp {
2929
class newDatetimeVector : public NumericVector {
3030
public:
3131
template <int RTYPE, bool NA, typename VEC>
32-
newDatetimeVector( const VectorBase<RTYPE,NA,VEC>& other ) :
32+
newDatetimeVector(const VectorBase<RTYPE,NA,VEC>& other) :
3333
NumericVector(other) {}
34-
34+
3535
newDatetimeVector(SEXP vec, const char* tz = "") :
3636
NumericVector(vec) {
3737
setClass(tz);
3838
}
39-
39+
4040
newDatetimeVector(int n, const char* tz = "") :
4141
NumericVector(n) {
4242
setClass(tz);

0 commit comments

Comments
 (0)