[Rcpp-devel] feature proposal: ListOf

Romain Francois romain at r-enthusiasts.com
Wed Oct 23 14:31:14 CEST 2013


Le 23/10/2013 13:47, Dirk Eddelbuettel a écrit :
>
> 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.

That means it will take me more time than what I wanted to commit to 
this. I'll come back to it later then.

> | 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
>


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



More information about the Rcpp-devel mailing list