[Rcpp-devel] feature proposal: ListOf

Smith, Dale (Norcross) Dale.Smith at Fiserv.com
Wed Oct 23 13:32:18 CEST 2013


Interesting. Again, I would say "build it and they will use it".

Dale Smith, Ph.D.
Senior Financial Quantitative Analyst
Financial & Risk Management Solutions
Fiserv
Office: 678-375-5315
www.fiserv.com

-----Original Message-----
From: rcpp-devel-bounces at r-forge.wu-wien.ac.at [mailto:rcpp-devel-bounces at r-forge.wu-wien.ac.at] On Behalf Of Romain Francois
Sent: Monday, October 21, 2013 8:33 AM
To: Rcpp-devel at r-forge.wu-wien.ac.at
Subject: [Rcpp-devel] feature proposal: ListOf

Hello,

Another thing I have developped in dplyr but might be generally useful is the ListOf class. See https://github.com/hadley/dplyr/blob/master/inst/include/tools/ListOf.h

The idea is to embed, by means of the template parameter what this list contains. Of course it is only usable if the list contains only objects that are compatible with the type.

So if we knew we had a list of numeric vector, we could use :

ListOf<NumericVector>, or ListOf< std::vector<double> >

so that when we use LisOf extracting operator, we know what we get. This is something I've shared a few times on mailing list and SO, but could be generally useufl for Rcpp users.

Do people want to see this in Rcpp.

This is orthogonal to everything else, so the risk is minimum. This is a template class, so the cost is null if the class is not used.

Romain

--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30

_______________________________________________
Rcpp-devel mailing list
Rcpp-devel at lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


More information about the Rcpp-devel mailing list