yeah, including <iostream> throws a whole big heap of code into your program... just as an examle, iostream #includes at least <istream> and <ostream>, <istream> includes <ios> and <limits>, <ostream> just includes <ios>.
<ios> has it's own list of includes, as follows:
Code:
#include <iosfwd>
#include <exception> // For ios_base::failure
#include <bits/char_traits.h> // For char_traits, streamoff, streamsize, fpos
#include <cstdio> // For SEEK_SET, SEEK_CUR, SEEK_END
#include <bits/localefwd.h> // For class locale
#include <bits/ios_base.h> // For ios_base declarations.
#include <streambuf>
#include <bits/basic_ios.h>
stopping at <ios> for the sake of sanity, I'll count how many new lines of code were just #included into mine (this will depend on your compiler's implementation):
<limits> in itself is 1,143 lines long, <ios> is 53 lines long, <istream> is 774 lines long, <ostream> is 548 lines long, and <iostream> is 80 lines long.
that makes at least 2,598 extra lines. that's not including all those other files that <ios> included, but I assure you it's thousands more than that.
however, as I said before, pretending that <ios> is the end of the train, you can see that this 'hello world' application:
Code:
#include<iostream>
int main()
{
std::cout<<"Hello World";
}
ends up being over 2,600 lines... way over.
in other words, simply #including <iostream> brings in so many lines of code, that it inflates the size of your program in a way that you would have to write hundreds, maybe a thousand lines of code to see any significant change in the size of your code.