Redirect a stream to some other stream, by default a null stream. \param out Stream to redirect. \param dst Destination stream. \return Context for stream restoration (see \ref restore()). */
| 636 | \return Context for stream restoration (see \ref restore()). |
| 637 | */ |
| 638 | inline RedirectStream redirect(std::ostream& out, std::ostream& dst) |
| 639 | { |
| 640 | RedirectStream redir; |
| 641 | |
| 642 | redir.m_buf = out.rdbuf(); |
| 643 | out.rdbuf(dst.rdbuf()); |
| 644 | return redir; |
| 645 | } |
| 646 | |
| 647 | /** |
| 648 | Redirect a stream to a null stream. |