<div dir="ltr">Yes, escaping from the check seems difficult. I have created a quick PR on this for further discussion.<div><br></div><div>Watal</div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Oct 27, 2018 at 2:13 AM Dirk Eddelbuettel <<a href="mailto:edd@debian.org">edd@debian.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi Watal,<br>
<br>
Thanks for being patient with me :)<br>
<br>
On 27 October 2018 at 01:26, Watal M. Iwasaki wrote:<br>
| Sorry for my poor explanation. I have read<br>
| `inst/include/Rcpp/iostream/Rstreambuf.h` and think I understand the role<br>
| of Rcpp::Rcout, but failed to explain my point. By "users [...] can just<br>
| stick to std::cout", I did not mean allowing users to write to stdout via<br>
| std::cout. It is about changing the destination of std::cout from stdout to<br>
| R's i/o. The following code hopefully explains better:<br>
| <br>
| ```<br>
| // [[Rcpp::export]]<br>
| void example_function() {<br>
|     // Normal state<br>
|     std::cout   << "to stdout; BAD\n";<br>
|     Rcpp::Rcout << "to R's i/o\n";<br>
| <br>
|     // Ideal state<br>
|     std::streambuf* stdoutbuf = std::cout.rdbuf(Rcpp::Rcout.rdbuf());<br>
|     std::cout   << "to R's i/o via Rcpp::Rcout.buf; GOOD\n"<br>
|     Rcpp::Rcout << "to R's i/o\n";<br>
| <br>
|     // Restore original state<br>
|     std::cout.rdbuf(stdoutbuf);<br>
|     std::cout   << "to stdout; BAD\n";<br>
|     Rcpp::Rcout << "to R's i/o\n";<br>
| }<br>
| ```<br>
| <br>
| In other words, we don't have to replace std::cout with Rcpp::Rcout. We<br>
| only have to change its buffer.<br>
<br>
I like it!  I think that may fix it.<br>
<br>
It may not fix the detection by R CMD check, but if we can show that we do<br>
the right thing maybe this can be adjusted (to also account for Rcpp and<br>
whatever (hidden) macro we may use to provide this.<br>
<br>
Dirk<br>
<br>
-- <br>
<a href="http://dirk.eddelbuettel.com" rel="noreferrer" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Watal M. Iwasaki / 岩嵜 航<br>SOKENDAI, The Graduate University for Advanced Studies,<br>Hayama, Kanagawa 240-0193, Japan<br>+81-46-858-1576<br><a href="https://heavywatal.github.io/" target="_blank">https://heavywatal.github.io/</a></div></div>