[Rcpp-commits] r4020 - pkg/Rcpp/inst/include/Rcpp/iostream

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Nov 22 18:42:30 CET 2012


Author: romain
Date: 2012-11-22 18:42:30 +0100 (Thu, 22 Nov 2012)
New Revision: 4020

Modified:
   pkg/Rcpp/inst/include/Rcpp/iostream/Rostream.h
Log:
yet another commit about Rostream

Modified: pkg/Rcpp/inst/include/Rcpp/iostream/Rostream.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/iostream/Rostream.h	2012-11-22 16:11:21 UTC (rev 4019)
+++ pkg/Rcpp/inst/include/Rcpp/iostream/Rostream.h	2012-11-22 17:42:30 UTC (rev 4020)
@@ -32,9 +32,13 @@
 namespace Rcpp {
 
     class Rostream : public std::ostream {
+        Rstreambuf* buf ;
     public:
-        Rostream(bool output) : std::ostream( new Rstreambuf(output) ) {}
-        ~Rostream(){ delete rdbuf() ; }
+        Rostream(bool output) : 
+            std::ostream( new Rstreambuf(output) ), 
+            buf( static_cast<Rstreambuf*>( rdbuf() ) )
+        {}
+        ~Rostream(){ delete buf ; }
     };
     
     // declare global variable



More information about the Rcpp-commits mailing list