Skip to content

Commit 9d5ce8b

Browse files
committed
Add default ctor for Date(time)Vector classes
1 parent dcd5779 commit 9d5ce8b

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2025-05-23 Dirk Eddelbuettel <[email protected]>
2+
3+
* inst/include/Rcpp/date_datetime/newDateVector.h: Add default
4+
constructor
5+
* inst/include/Rcpp/date_datetime/newDatetimeVector.h: Idem
6+
17
2025-05-06 Dirk Eddelbuettel <[email protected]>
28

39
* DESCRIPTION (Version, Date): Roll micro version and date

inst/include/Rcpp/date_datetime/newDateVector.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// newDateVector.h: Rcpp R/C++ interface class library -- Date vector support
44
//
5-
// Copyright (C) 2016 Dirk Eddelbuettel
5+
// Copyright (C) 2016 - 2025 Dirk Eddelbuettel
66
//
77
// This file is part of Rcpp.
88
//
@@ -28,6 +28,10 @@ namespace Rcpp {
2828

2929
class newDateVector : public NumericVector {
3030
public:
31+
newDateVector() : NumericVector() {
32+
setClass();
33+
}
34+
3135
template <int RTYPE, bool NA, typename VEC>
3236
newDateVector(const VectorBase<RTYPE,NA,VEC>& vec) : NumericVector(vec) {
3337
setClass();

inst/include/Rcpp/date_datetime/newDatetimeVector.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ namespace Rcpp {
2828

2929
class newDatetimeVector : public NumericVector {
3030
public:
31+
newDatetimeVector(const char* tz = "") : NumericVector() {
32+
setClass(tz);
33+
}
34+
3135
template <int RTYPE, bool NA, typename VEC>
3236
newDatetimeVector(const VectorBase<RTYPE,NA,VEC>& other, const char* tz = "") :
3337
NumericVector(other) {
34-
setClass(tz);
38+
setClass(tz);
3539
}
3640

3741
newDatetimeVector(SEXP vec, const char* tz = "") :

0 commit comments

Comments
 (0)