mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-07 12:01:16 +00:00
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>.
This commit is contained in:

committed by
Jesse Beder

parent
7470c2d871
commit
73ef0060aa
@@ -7,7 +7,6 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
#include <cstddef>
|
||||
|
||||
#include "yaml-cpp/ostream_wrapper.h"
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
#include <ostream>
|
||||
|
||||
namespace YAML {
|
||||
ostream_wrapper::ostream_wrapper()
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#include <iostream>
|
||||
#include <istream>
|
||||
|
||||
#include "stream.h"
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
#include <cstddef>
|
||||
#include <deque>
|
||||
#include <ios>
|
||||
#include <iostream>
|
||||
#include <istream>
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
|
@@ -8,7 +8,7 @@
|
||||
#endif
|
||||
|
||||
#include "yaml-cpp/mark.h"
|
||||
#include <iostream>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
Reference in New Issue
Block a user