Subject: [Boost-bugs] [Boost C++ Libraries] #8327: iostream header and std::cout in hpp files must be removed.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-03-23 10:36:49
#8327: iostream header and std::cout in hpp files must be removed.
------------------------------+---------------------------------------------
Reporter: pjtsu | Owner: johnmaddock
Type: Support Requests | Status: new
Milestone: To Be Determined | Component: math
Version: Boost 1.53.0 | Severity: Problem
Keywords: |
------------------------------+---------------------------------------------
I think that direct including iostream header and ostream instance like
cout, cerr or so must be deprecated.
Reasons
* to support environment which ostream is forbidden like embedded systems.
* to entrust output type to library user.
Alternative plan is to replace ostream instance to template-type as
below.[[BR]]
- before
{{{#!c
template <typename Iter>
void PrintTest(Iter first, Iter last)
{
std::cout << std::distance(first, last) << ": ( ";
for (Iter iter = first; iter != last; ++iter) {
std::cout << *iter << " ";
}
std::cout << ")" << std::endl;
}
}}}
- after
{{{#!c
template <typename Stream, typename Iter>
void PrintTest(Stream& ostr, Iter first, Iter last)
{
ostr << std::distance(first, last) << ": ( ";
for (Iter iter = first; iter != last; ++iter) {
ostr << *iter << " ";
}
ostr << ")" << std::endl;
}
}}}
- Even if ostream header is not included, std::distance() and std::endl
are ignored until !PrintTest() is substantialized.
Subject
* boost/algorithm/searching/detail/debugging.hpp
* boost/graph/graph_utility.hpp
* boost/math/constants/generate.hpp
* boost/pending/relaxed_heap.hpp
* or so ...
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8327> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC