Skip to content

Add default ctor for Date(time)Vector classes #1384

Closed
@eddelbuettel

Description

@eddelbuettel

One of the more amusing aspects of Rcpp is just how spectacularly bad my design for the (original) Date and Datetime vector (and scalar !) types was. (In my defense, I knew little R and was driven by what QuantLib did with std::vector.) I did a first cleanup a decade (give or take) ago, but given the (not needed, really) scalar classes I omitted default constructors for zero length vectors.

R 4.5.0 now behaves differently for zero-length vectors. It shows less tolerance, and bonks out more clearly. This became apparent this week in issue #135 in anytime where I now (in a branch for now, release "soon") cover the case of construction from integer() or numeric(). But this lead to some introspection here too (ahem!!) and I sketched in two simple default constructors which seem to work. As this simply expands the API surface I do not expect trouble.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions