[Rcpp-devel] Rcpp constructor validator help

Dirk Eddelbuettel edd at debian.org
Sun Nov 6 18:33:21 CET 2016

On 6 November 2016 at 11:36, Anon User wrote:
| Hi,
| 	Could someone point me to documentation or provide an example on how to use constructor validator to handle the following case:

Could you provide a definition or reference for 'constructor validator'?
That is not a term we use here regularly.

| 	class Foo;
| 	struct Bar
| 	{ 
| 		Bar(const Foo&, int);
| 		Bar(int,  int);
|| 	};
| 	I would like to find a way for the R user to build a Bar object using either one of the constructors. 
| 	Your help is much appreciated!

Well 'Foo' is not something R or Rcpp knows about so you would have to write
converters first.  See Rcpp-extending for as<>() and wrap().  But I would
start simpler with basic interfaces using known Rcpp types and/or atomistic
C++ types.


http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org

More information about the Rcpp-devel mailing list