Commit 73ef0060 by Jeremy Nimmer Committed by Jesse Beder

Avoid including <iostream> in library code

Including iostream means introducing the static (global) constructors
and destructors for std::cin, std::cerr, and std::cout. That extra
init and fini code is undesirable when those streams are not actually
used.

Instead, we'll use the narrower includes for exactly what's needed,
i.e., <istream> or <ostream>.
parent 7470c2d8
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#pragma once #pragma once
#endif #endif
#include <iostream>
#include <cstddef> #include <cstddef>
#include "yaml-cpp/ostream_wrapper.h" #include "yaml-cpp/ostream_wrapper.h"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>
#include <iostream> #include <ostream>
namespace YAML { namespace YAML {
ostream_wrapper::ostream_wrapper() ostream_wrapper::ostream_wrapper()
......
#include <iostream> #include <istream>
#include "stream.h" #include "stream.h"
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <cstddef> #include <cstddef>
#include <deque> #include <deque>
#include <ios> #include <ios>
#include <iostream> #include <istream>
#include <set> #include <set>
#include <string> #include <string>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#endif #endif
#include "yaml-cpp/mark.h" #include "yaml-cpp/mark.h"
#include <iostream> #include <ostream>
#include <string> #include <string>
#include <vector> #include <vector>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment