• Advertisement
Sign in to follow this  

using namespace std -- Does that make the exe huge?

This topic is 4850 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

(obviously talking about C++) Should I just say using std::whatever instead of using namespace std;? I made a really small text-based game, and it was like 500k...I figured it'd be under 50, so is it because I said using namespace std? Also, I can just throw those using std::whatever declarations in a header, right?

Share this post


Link to post
Share on other sites
Advertisement
it shouldn't matter, they're going to be linked the same way anyway(and, yes, it's ok use the std:: in headers)

Share this post


Link to post
Share on other sites
Quote:
Original post by Bombario
Should I just say using std::whatever instead of using namespace std;?

In headers, you should preferably fully qualify all the names (std::vector, std::string, et cetera), and not use any using directives. The less you dump into the global namespace, the better. (using bla::whatever over using namespace bla is of course less bad, but as others have pointed out, the reasons have nothing to do with the size of the finished executable.)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement