<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is it a big deal that we would cheat on chat reference passing means ?<br>
</blockquote><div><br></div><div>If you want to implement these sort of semantics I think at a _minimum_ the type should be const & (otherwise it looks like you are going to actually modify the matrix in place which would appear to bypass the implicit memory barrier of SEXP). Realize that you won't actually bypass the memory barrier but it sure looks like you intend to for a reader of the code.</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
        Rcpp::RNGScope __rngScope;<br>
        arma::mat& m = Rcpp::as<arma::mat& >(mSEXP);<br>
        test_ref(m);<br></blockquote><div><br></div><div>It looks like this behavior changed as of rev 4400 when the full_name() method was introduced. I may not understand the mechanism you established 100% but to me this generated code looks potentially problematic if you are taking a reference to a stack variable establish within the as<> method. My guess is that you have something more sophisticated going on here and there is no memory problem, however I'd love to understand things a bit better to be 100% sure there isn't something to drill into further.</div>
<div><br></div><div><br></div></div></div></div>