[Rcpp-devel] Segfault in wrapping code in Rcpp

2024-03-01 Thread Nikhil Garg
Hi, I am currently working on wrapping some code from a C++ library. I am using RCPP for this work. I have managed to get the wrapping code compiled but I get segfault when I try to use some of the functionality. Here is an example of how I have gone about it, though I think I am quite sure I am

Re: [Rcpp-devel] Wrapping a c++ class with singleton using RCPP Module

2024-02-21 Thread Nikhil Garg
POSED_CLASS(Foo) >>> >>> Foo& GetSingleton(){ >>> Foo* foo_singleton = Foo::GetSingleton(); >>> Rcpp::Rcout<<"From \"Foo& GetSingleton()\" -> memory address for >>> singleton is " <>> return *foo_singleton; >&g

[Rcpp-devel] Wrapping a c++ class with singleton using RCPP Module

2024-02-20 Thread Nikhil Garg
Hi, I am looking for some advice or hoping someone can point me in the right direction for wrapping a C++ class with singleton using Rcpp. I have been using RCPP modules for some of this work but got stuck with a C++ object which returns a singleton. Here is the general structure of the object