Skip to content
Prev 490 / 10988 Next

[Rcpp-devel] Vector<>::create

On 19 March 2010 at 17:05, Romain Francois wrote:
| Done. Named is no longer a class but two templated functions. The 
| interface is 100% preserved, and is extended to simpler vectors.
| 
| Not a single line of the unit tests has changed.
| 
| This shows that both interfaces can be used with simpler types:
| 
| fx <- cfunction( signature(), '
|          return IntegerVector::create(
|                  Named( "foo" ) = 20,
|                  Named( "bar", 30 ) ) ;
| ', Rcpp = TRUE, includes = "using namespace Rcpp;" )
| 
| 
|  > fx()
| foo bar
|   20  30

Chapeau!  Well done. 

Like other lethal weapons, C++ can be quite effective when handled by a professinal :-)

Dirk