Why does `include <iostream>` end, including so many * files?

Follow this question :

When i do include <iostream>.
It happens that it includes many files from /usr/include.A grep "\usr\include"over g++ -E prog.cpp, counted approximately 1260 records;).

Is their way to control including various files?
Platform: Linux
g ++ Version: 4.2.4

+3
source share
3 answers

No, it <iostream>includes them, because they depend on them directly, or the dependencies depend on them.

There is nothing you can do about it.

( ) , ,

+11

, . , , . , , , . , , . - EVIL.

, . , .

- , ., . , .

+3

You #include <iostream>when you need to use threads. This should determine some of the things you need. What kind of activity he should carry out is a problem of quality of implementation. You can delete files from /usr/include, but it can break things.

I really doubt it, including 1260 files. Most likely, most of them are duplicate entries that do not load anything, but are not clipped from the output -E.

+2
source

Source: https://habr.com/ru/post/1724765/


All Articles