Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "using namespace std" from stubs/common.h #3018

Merged
merged 1 commit into from
Apr 26, 2017

Conversation

acozzette
Copy link
Member

This prevents the contents of the std namespace from being effectively
pulled into the top-level namespace in all translation units that
include common.h. I left in individual using statements for a few common
things like std::set and std::map, because it did not seem worth going
through the churn of updating the whole codebase to fix those right now.

@acozzette acozzette requested a review from xfxyjwf April 26, 2017 00:18
@@ -220,7 +225,13 @@ class FatalException : public std::exception {

// This is at the end of the file instead of the beginning to work around a bug
// in some versions of MSVC.
using namespace std; // Don't do this at home, kids.
using std::istream;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a TODO here? I think we want to get rid of these using statements in public header files as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, I've added a TODO there.

@acozzette acozzette force-pushed the using-namespace-std branch from 2c990e7 to 20d1e15 Compare April 26, 2017 15:23
This prevents the contents of the std namespace from being effectively
pulled into the top-level namespace in all translation units that
include common.h. I left in individual using statements for a few common
things like std::set and std::map, because it did not seem worth going
through the churn of updating the whole codebase to fix those right now.
@acozzette acozzette force-pushed the using-namespace-std branch from 20d1e15 to 7c76ac1 Compare April 26, 2017 15:25
@acozzette acozzette merged commit cbd08cb into protocolbuffers:master Apr 26, 2017
@acozzette acozzette deleted the using-namespace-std branch April 26, 2017 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants