Re: [protobuf] Re: Issue 195 in protobuf: common.h should not have "using namespace std;"

2014-08-05 Thread 'Feng Xiao' via Protocol Buffers
On Tue, Aug 5, 2014 at 4:53 AM,  wrote:

>
> Comment #11 on issue 195 by etienne@gmail.com: common.h should not
> have "using namespace std;"
> http://code.google.com/p/protobuf/issues/detail?id=195
>
> Hello google !
>
> I just ran into this "using namespace std;" in common.h...
>
> Do you guys have any plans to remove this ugly using from the header file ?
>
No.


>
> It would be easier for my project to use the whole google::protobuf
> namespace, but I cannot do that otherwise I use the whole std namespace
> too, which I do not want.

Please don't do that. Your project should use its own namespace.


>
>
>
>
> --
> You received this message because this project is configured to send all
> issue notifications to this address.
> You may adjust your notification preferences at:
> https://code.google.com/hosting/settings
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at http://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Re: Issue 195 in protobuf: common.h should not have "using namespace std;"

2010-06-04 Thread Monty Taylor
On 06/04/2010 11:48 AM, proto...@googlecode.com wrote:
> 
> Comment #3 on issue 195 by jmccaskey: common.h should not have "using
> namespace std;"
> http://code.google.com/p/protobuf/issues/detail?id=195
> 
> Ok, it looks like this *is* a Visual C++ bug.  I can simplify my test
> program down to
> the following and the errors still occur and the using namespace std
> does appear to
> leak out of it's proper scope.  I can't reproduce the same behavior with
> gcc on osx.
> 
> I'll go look for possible VC++ hotfixes that may address the issue. 
> Still might be
> nice if this could be avoided for VC++ users.

/me is increasingly in favor of disallowing all use of using namespace *
in his own code, even inside of other namespaces.

> // test.cpp : Defines the entry point for the console application.
> //
> 
> #include 
> 
> namespace google {
> namespace protobuf {
> 
> using namespace std;
> 
> 
> namespace internal {
> 
> template 
> struct CompileAssert {
> };
> 
> }  // namespace internal
> 
> }
> }
> 
> 
> template< class T >
> void swap( T &a, T &b )
> {
> T tmp = a;
> a = b;
> b = tmp;
> }
> 
> 
> int _tmain(int argc, _TCHAR* argv[])
> {
> int one = 1;
> int two = 2;
> 
> swap( one, two );
> return 0;
> }
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.