<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi, Vissarion,<div><br></div><div>If I understand your problem correctly, you can use "TYPEOF" from R's C API.</div><div><br></div><div>You can find more info on the type of an R object from <a href="https://cran.r-project.org/doc/manuals/r-release/R-ints.html#SEXPTYPEs">https://cran.r-project.org/doc/manuals/r-release/R-ints.html#SEXPTYPEs</a></div><div><br></div><div>The return value of this macro is an integer: <a href="https://github.com/wch/r-source/blob/master/src/include/Rinternals.h#L94-L126">https://github.com/wch/r-source/blob/master/src/include/Rinternals.h#L94-L126</a></div><div><br></div><div>Hadley also gives several examples in <a href="http://adv-r.had.co.nz/C-interface.html">http://adv-r.had.co.nz/C-interface.html</a></div><div><br></div><div>Best,</div><div><br></div><div>KK</div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Oct 13, 2018 at 2:49 PM Vissarion Fisikopoulos <<a href="mailto:fisikop@gmail.com">fisikop@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I am working on a rcpp project. I have a set of templated C++ classes<br>
and templated C++ functions that accept  any object from that set of<br>
classes as parameter. I want to expose this functionality to R using<br>
Rcpp. That is, the R user could create objects (that correspond to the<br>
set of C++ classes) and then call a function with those objects as<br>
parameters.<br>
<br>
My main issue is that I cannot extract from an R Class any type that<br>
can be used to parameterise a C++ templated function.<br>
<br>
Is there a standard way to do such an exposion within rcpp?<br>
<br>
Best,<br>
Vissarion<br>
_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org" target="_blank">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" rel="noreferrer" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
</blockquote></div>