<div dir="ltr"><div>Hi Dirk and Sokol, thanks for the responses.</div><div>Dirk I was aware that the C/C++ output type of wrap is always SEXP, but I my question was about the R type/class.</div><div>Also thanks for the ref of the discussion in Sec 3.1 of the JSS 2011 article, which is pretty much what I was looking for, but it seems to be incomplete. I can deduce from the example that std::vector becomes a list in R, and std::map<string, int> becomes a named integer vector in R, but I am looking for a list of all such conversions that have currently been implemented.</div><div>I guess there is no such documentation, and we should instead refer to the source code as Seugeui pointed out?</div><div>In that case I find it a bit problematic, because there are lots of conversions that are possible, but not obvious upon inspection of wrap.h. For example the std::vector -> R list conversion is not obvious (I don't see any mention of std::vector in wrap.h actually). <br></div><div>As an Rcpp user I think it would be very helpful to have a list/table that documents all the currently implemented conversions. Would that be very difficult to write by hand / generate from the source code?<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Apr 26, 2020 at 12:07 AM Sokol Serguei <<a href="mailto:sokol@insa-toulouse.fr">sokol@insa-toulouse.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Le 26/04/2020 à 01:19, Dirk Eddelbuettel a écrit :<br>
> On 25 April 2020 at 16:04, Toby Hocking wrote: | Hi, can someone <br>
> please tell me where the return types of wrap are | documented? The <br>
> _return_ value of a wrap() call is by definition always SEXP. Just how <br>
> the _input_ for as<>() converters is always a SEXP. For wrap(), see <br>
> e.g. Section 3.1 of the JSS 2011 paper which ships as vignette <br>
> Rcpp-jss-2011.pdf <br>
To complete the Dirk's response, this gallery example can be of some help:<br>
<a href="https://gallery.rcpp.org/articles/custom-templated-wrap-and-as-for-seamingless-interfaces/" rel="noreferrer" target="_blank">https://gallery.rcpp.org/articles/custom-templated-wrap-and-as-for-seamingless-interfaces/</a><br>
<br>
And as always, an ultimate place to clarify the trickiest questions is <br>
the code itself ;) :<br>
<a href="https://github.com/sgsokol/Rcpp/blob/master/inst/include/Rcpp/internal/wrap.h" rel="noreferrer" target="_blank">https://github.com/sgsokol/Rcpp/blob/master/inst/include/Rcpp/internal/wrap.h</a><br>
<br>
Best,<br>
Serguei.<br>
</blockquote></div>