[Rcpp-devel] feature proposal: ListOf

Dirk Eddelbuettel edd at debian.org
Wed Oct 23 13:47:04 CEST 2013


On 21 October 2013 at 14:32, Romain Francois wrote:
| 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.

Sure. 

As always, preferably with a usage example (Rcpp Gallery post?  Section in a (new)
vigntte?) and tests so that people have some info on how to use it.
 
| 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.

And R-Forge is currently healthy so we do get build and test reports within
about 24 hours of a commit too.

Dirk

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com


More information about the Rcpp-devel mailing list