<small id='XGcT7'></small><noframes id='XGcT7'>

    1. <i id='XGcT7'><tr id='XGcT7'><dt id='XGcT7'><q id='XGcT7'><span id='XGcT7'><b id='XGcT7'><form id='XGcT7'><ins id='XGcT7'></ins><ul id='XGcT7'></ul><sub id='XGcT7'></sub></form><legend id='XGcT7'></legend><bdo id='XGcT7'><pre id='XGcT7'><center id='XGcT7'></center></pre></bdo></b><th id='XGcT7'></th></span></q></dt></tr></i><div id='XGcT7'><tfoot id='XGcT7'></tfoot><dl id='XGcT7'><fieldset id='XGcT7'></fieldset></dl></div>
      <legend id='XGcT7'><style id='XGcT7'><dir id='XGcT7'><q id='XGcT7'></q></dir></style></legend>

        <tfoot id='XGcT7'></tfoot>

        • <bdo id='XGcT7'></bdo><ul id='XGcT7'></ul>

        C++ 或库中是否有空 std::ostream 实现?

        Is there a null std::ostream implementation in C++ or libraries?(C++ 或库中是否有空 std::ostream 实现?)
          <bdo id='ThDKo'></bdo><ul id='ThDKo'></ul>

            • <i id='ThDKo'><tr id='ThDKo'><dt id='ThDKo'><q id='ThDKo'><span id='ThDKo'><b id='ThDKo'><form id='ThDKo'><ins id='ThDKo'></ins><ul id='ThDKo'></ul><sub id='ThDKo'></sub></form><legend id='ThDKo'></legend><bdo id='ThDKo'><pre id='ThDKo'><center id='ThDKo'></center></pre></bdo></b><th id='ThDKo'></th></span></q></dt></tr></i><div id='ThDKo'><tfoot id='ThDKo'></tfoot><dl id='ThDKo'><fieldset id='ThDKo'></fieldset></dl></div>

              <small id='ThDKo'></small><noframes id='ThDKo'>

              1. <legend id='ThDKo'><style id='ThDKo'><dir id='ThDKo'><q id='ThDKo'></q></dir></style></legend>
                    <tbody id='ThDKo'></tbody>
                1. <tfoot id='ThDKo'></tfoot>

                2. 本文介绍了C++ 或库中是否有空 std::ostream 实现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在寻找一个 std::ostream 实现,它的作用类似于 /dev/null.它只会忽略流式传输到它的任何内容.标准库或Boost中是否存在这样的东西?还是我必须自己滚动?

                  I'm looking for a std::ostream implementation that acts like /dev/null. It would just ignore anything that is streamed to it. Does such a thing exist in the standard libraries or Boost? Or do I have to roll my own?

                  推荐答案

                  如果你有 boost,那么就有一个 null ostream &在 boost/iostreams/device/null.hpp 中可用的 istream 实现.要点:

                  If you have boost, then there's a null ostream & istream implementation available in boost/iostreams/device/null.hpp . The gist of it:

                  #include "boost/iostreams/stream.hpp"
                  #include "boost/iostreams/device/null.hpp"
                  ...
                  boost::iostreams::stream< boost::iostreams::null_sink > nullOstream( ( boost::iostreams::null_sink() ) );
                  ...
                  

                  这篇关于C++ 或库中是否有空 std::ostream 实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  C++ stl unordered_map implementation, reference validity(C++ stl unordered_map 实现,参考有效性)
                  C++: Is it possible to use a reference as the value in a map?(C++:是否可以使用引用作为映射中的值?)
                  Where ampersand quot;amp;quot; can be put when passing argument by reference?(其中符号“amp;通过引用传递参数时可以放置吗?)
                  Why can a non-const reference parameter be bound to a temporary object?(为什么可以将非常量引用参数绑定到临时对象?)
                  What is a dangling reference?(什么是悬空引用?)
                  C++ reference changes when push_back new element to std::vector(当 push_back 新元素到 std::vector 时,C++ 引用发生变化)
                  <i id='PflfH'><tr id='PflfH'><dt id='PflfH'><q id='PflfH'><span id='PflfH'><b id='PflfH'><form id='PflfH'><ins id='PflfH'></ins><ul id='PflfH'></ul><sub id='PflfH'></sub></form><legend id='PflfH'></legend><bdo id='PflfH'><pre id='PflfH'><center id='PflfH'></center></pre></bdo></b><th id='PflfH'></th></span></q></dt></tr></i><div id='PflfH'><tfoot id='PflfH'></tfoot><dl id='PflfH'><fieldset id='PflfH'></fieldset></dl></div>

                      <tbody id='PflfH'></tbody>
                  1. <legend id='PflfH'><style id='PflfH'><dir id='PflfH'><q id='PflfH'></q></dir></style></legend>

                      <bdo id='PflfH'></bdo><ul id='PflfH'></ul>

                      1. <tfoot id='PflfH'></tfoot>

                        <small id='PflfH'></small><noframes id='PflfH'>