>>48
It might depend on the version. I have at least these when using MSVC6:
.?AVexception@@
.?AVbad_cast@std@@
.?AVios_base@std@@
.?AV?$basic_ios@DU?$char_traits@D@std@@@std@@
.?AV?$basic_istream@DU?$char_traits@D@std@@@std@@
...
But more shockingly (or maybe not so if you're familiar with
cout and friends, although I am (was) and it still surprises me today), the executable was
100KB.
One hundred thousand bloody bytes. That's about the size of the earlier versions of uTorrent. All just to create a single object and print out one of its members. Compiling with /MD brought that down to a bit more reasonable 16KB, but that's still full of empty space (and has the names above). This is what I meant in
>>11. The language gives you the power to generate immense amounts of code, but to use it responsibly is a different matter. Someone with a newer version can report their experiences with compiling the same code with default settings, I doubt it's any better.
(I consider that
iostream is part of "the original source" because of how the preprocessor works.)
In contrast,
#include <stdio.h>
struct my_class
{
int member_x;
float member_y;
};
void construct_my_class(struct my_class *this)
{ this->member_x = 5; this->member_y = 5.0f; }
void method_z_my_class(struct my_class *this)
{ this->member_x++; this->member_y++; }
int main(int argc, char **argv)
{
struct my_class instance;
construct_my_class(&instance);
printf("%d\n", instance.member_x);
return 0;
}
is 48KB with the default settings and there is no mention of
printf.