Dear Dirk, Is it possible for Rcpp to do some pre-execution hook before user code? For example, if Rcpp system can hijack the std::cout buffer by executing `std::cout.rdbuf(Rcpp::Rcout.rdbuf())` automatically, then Rcpp users (and external libraries) no longer have to care about Rcout, and can just stick to std::cout.
Best, Watal On Fri, Oct 26, 2018 at 10:12 PM Dirk Eddelbuettel <e...@debian.org> wrote: > > On 26 October 2018 at 22:03, Watal M. Iwasaki wrote: > | Dear Dirk, > | > | Thank you for the prompt response. Good to know there is no easy way. I > | have made up my mind to change the library code as you suggested. But I > | don't like preprocessor macro; therefore, the problem here was solved by > | moving/hiding `std::cout.rdbuf()` part into the library as a function > that > | takes a streambuf pointer, and just calling it from Rcpp side. Now, > output > | is properly sent to R console, R CMD check complains nothing, and the > | library still remains free from R/Rcpp code. Thanks again. > > Nicely done. > > We could do with a more general solution to this. If you have ideas ... > > Dirk > > -- > http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org > -- Watal M. Iwasaki / 岩嵜 航 SOKENDAI, The Graduate University for Advanced Studies, Hayama, Kanagawa 240-0193, Japan +81-46-858-1576 https://heavywatal.github.io/
_______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel