Skip to content

Commit 90f9487

Browse files
committed
add operator double() to Date, Datetime
roll Version, Date
1 parent 6f291db commit 90f9487

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2016-10-18 Dirk Eddelbuettel <[email protected]>
2+
3+
* inst/include/Rcpp/date_datetime/Date.h (Rcpp): Add operator double()
4+
* inst/include/Rcpp/date_datetime/Datetime.h (Rcpp): Ditto
5+
16
2016-10-17 Dirk Eddelbuettel <[email protected]>
27

38
* inst/include/Rcpp/date_datetime/newDatetimeVector.h (Rcpp): Allow

DESCRIPTION

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Package: Rcpp
22
Title: Seamless R and C++ Integration
3-
Version: 0.12.7.1
4-
Date: 2016-09-05
5-
Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey,
6-
Qiang Kou, Douglas Bates and John Chambers
3+
Version: 0.12.7.2
4+
Date: 2016-10-18
5+
Author: Dirk Eddelbuettel, Romain Francois [2009-2013], JJ Allaire, Kevin Ushey,
6+
Qiang Kou, Douglas Bates [2010-2012] and John Chambers
77
Maintainer: Dirk Eddelbuettel <[email protected]>
88
Description: The 'Rcpp' package provides R functions as well as C++ classes which
99
offer a seamless integration of R and C++. Many R data types and objects can be

inst/include/Rcpp/date_datetime/Date.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ namespace Rcpp {
9898
return traits::is_na<REALSXP>(m_d);
9999
}
100100

101+
operator double() const {
102+
return m_d;
103+
}
104+
101105
private:
102106
double m_d; // (fractional) day number, relative to epoch of Jan 1, 1970
103107
struct tm m_tm; // standard time representation

inst/include/Rcpp/date_datetime/Datetime.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ namespace Rcpp {
6565

6666
inline int is_na() const { return traits::is_na<REALSXP>(m_dt); }
6767

68+
operator double() const { return m_dt; }
69+
6870
private:
6971
double m_dt; // fractional seconds since epoch
7072
struct tm m_tm; // standard time representation

0 commit comments

Comments
 (0)