Skip to content

Commit

Permalink
Removed deprecated "operator <<" for rang::control
Browse files Browse the repository at this point in the history
  • Loading branch information
kingseva committed Jan 11, 2018
1 parent 56f11db commit 983ed27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
8 changes: 0 additions & 8 deletions include/rang.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,14 +494,6 @@ inline void setControlMode(const control value) noexcept
rang_implementation::controlMode() = value;
}

// This function should be deprecated, cause it affects all streams but not only "os" stream.
// Use rang::setControlMode instead.
inline std::ostream &operator<<(std::ostream &os, const rang::control value)
{
setControlMode(value);
return os;
}

} // namespace rang

#undef OS_LINUX
Expand Down
7 changes: 4 additions & 3 deletions test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ TEST_CASE("Rang printing to non-terminals")
cout.rdbuf(out.rdbuf());

// Make sure to turn color off
cout << control::offColor;
setControlMode(control::offColor);
cout << fg::blue << s << style::reset;

cout.rdbuf(coutbuf);
Expand All @@ -50,7 +50,7 @@ TEST_CASE("Rang printing to non-terminals")
streambuf *coutbuf = cout.rdbuf();
cout.rdbuf(out.rdbuf());

cout << control::forceColor;
setControlMode(control::forceColor);
cout << fg::blue << s << style::reset;

cout.rdbuf(coutbuf);
Expand Down Expand Up @@ -87,7 +87,8 @@ TEST_CASE("Rang printing to stdout/err")

SUBCASE("output is to terminal")
{
cout << control::forceColor << fg::green << s << "cout" << style::reset
rang::setControlMode(control::forceColor);
cout << fg::green << s << "cout" << style::reset
<< endl;
clog << fg::blue << s << "clog" << style::reset << endl;
cerr << fg::red << s << "cerr" << style::reset << endl;
Expand Down

0 comments on commit 983ed27

Please sign in to comment.