Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
Open
@eddelbuettel

Description

@eddelbuettel
Issue body actions

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

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.