3 ms·
As an illustration of how much code gets included (on macOS Sierra): $ echo "#include <iostream>" > foo.cpp $ g++ -E foo.cpp | wc 37799 104779 12808
by pg314 10y ago
As an illustration of how much code gets included (on macOS Sierra):
$ echo "#include <iostream>" > foo.cpp
$ g++ -E foo.cpp | wc
37799 104779 1280834
Including just iostream in a file means the compiler has to process 37799 (!) lines.
For comparison, a C file including stdio:
$ echo "#include <stdio.h>" | gcc -E - | wc
456 1638 20880
That still looks bloated to me, but is about 60x times fewer bytes.
- stirner 10y ago$ curl https://git.musl-libc.org/cgit/musl/plain/include/stdio.h | wc 203 630 5231