Re: [Rcpp-devel] Question regarding integrating preexisting C++ code via Rcpp

2011-10-10 Thread Davor Cubranic
Hi Simon, Are you wrapping your header file with an #ifndef to prevent it from being included multiple times? Davor On October 10, 2011 03:01:33 PM Simon Fuller wrote: > Hello, > > I am getting some problems further down the line. It seems to happen when I > am including a std header in my ow

Re: [Rcpp-devel] Question regarding integrating preexisting C++ code via Rcpp

2011-10-10 Thread Simon Fuller
Hello, I am getting some problems further down the line. It seems to happen when I am including a std header in my own class, and when it itself includes a header. Which suggests the problem is not with including headers in general. When it is reading my header, it gets this error in fstream: In

Re: [Rcpp-devel] returning std::pair using Rcpp

2011-10-10 Thread Jelmer Ypma
Thanks, I just solved my problem by defining a plugin that adds Rcpp::wrap for std::pair (see below including some examples). I couldn't find in which directories/files of the Rcpp package these wraps are usually defined, otherwise I'd happily supply a patch. Wrapping a std::pair of std::pair's doe

Re: [Rcpp-devel] Question regarding integrating preexisting C++ code via Rcpp

2011-10-10 Thread Dirk Eddelbuettel
On 10 October 2011 at 11:09, Simon Fuller wrote: | I am new to Rcpp, have some experience with both R and C++, but very little | experience with integrating languages. | | I hope to use Rcpp to develop code over the next few years. However, to begin | with, I have some preexisting C++ classes tha

Re: [Rcpp-devel] returning std::pair using Rcpp

2011-10-10 Thread Dirk Eddelbuettel
On 10 October 2011 at 12:26, Jelmer Ypma wrote: | Dear list, | | I tried to return a std::pair using Rcpp and inline (see example | below), but didn't succeed. Returning a std::map works fine. Does | anyone know whether this does not work because Rcpp::wrap has not been | implemented for std::pai

[Rcpp-devel] returning std::pair using Rcpp

2011-10-10 Thread Jelmer Ypma
Dear list, I tried to return a std::pair using Rcpp and inline (see example below), but didn't succeed. Returning a std::map works fine. Does anyone know whether this does not work because Rcpp::wrap has not been implemented for std::pair or because I'm doing something else wrong? The error I get

Re: [Rcpp-devel] Question regarding integrating preexisting C++ code via Rcpp

2011-10-10 Thread Romain François
Hello, It looks like you want to use Rcpp modules. See the "Rcpp-modules" vignette. > require( Rcpp ) > vignette( "Rcpp-modules" ) Or from CRAN: http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-modules.pdf Modules are still in (slow) dev, so they lack some features, but what exists

[Rcpp-devel] Question regarding integrating preexisting C++ code via Rcpp

2011-10-10 Thread Simon Fuller
Hello, I have just joined the mailing list. I was hoping you might be able to help me with a question. I am new to Rcpp, have some experience with both R and C++, but very little experience with integrating languages. I hope to use Rcpp to develop code over the next few years. However, to begin