HepMC3 event record library
Public Member Functions | Protected Attributes
scoped_estream_redirect Class Reference

#include <iostream.h>

+ Inheritance diagram for scoped_estream_redirect:
+ Collaboration diagram for scoped_estream_redirect:

Public Member Functions

 scoped_estream_redirect (std::ostream &costream=std::cerr, object pyostream=module_::import("sys").attr("stderr"))
 

Protected Attributes

std::streambuf * old
 
std::ostream & costream
 
detail::pythonbuf buffer
 

Detailed Description

\rst
Like `scoped_ostream_redirect`, but redirects cerr by default. This class
is provided primary to make ``py::call_guard`` easier to make.

.. code-block:: cpp

 m.def("noisy_func", &noisy_func,
       py::call_guard<scoped_ostream_redirect,
                      scoped_estream_redirect>());

Definition at line 145 of file iostream.h.


The documentation for this class was generated from the following file: