Thrift: No using namespace.
authorDavid Reiss <dreiss@apache.org>
Thu, 23 Aug 2007 02:37:19 +0000 (02:37 +0000)
committerDavid Reiss <dreiss@apache.org>
Thu, 23 Aug 2007 02:37:19 +0000 (02:37 +0000)
Summary:
using namespace XXX; is tricky because it imports a lot of crap into your namespace.
Also, if we ever decide to remove boost as a dependency, "using namespace boost"
makes it harder.

This patch removes all using namesapce XXX; with one or more using XXX::YYY;
There are some exceptions, such as test, tutorial, namespace std, and
facebook namespaces.

Reviewed By: mcslee

Test Plan:
Recompiled thrift.
grep --binary-files=without-match -r 'using namespace' . | \
  egrep -v '^[^:]*: *using namespace (std;$|facebook)' | \
  grep -v '<< endl' | \
  grep -v '[^:]*/tutorial/' | \
  grep -v '^./test/'

Revert Plan: ok

Notes: I wouldn't bother, but it is fixathon.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665218 13f79535-47bb-0310-9956-ffa450edef68

lib/cpp/src/concurrency/PosixThreadFactory.cpp
lib/cpp/src/concurrency/ThreadManager.cpp
lib/cpp/src/transport/TServerSocket.cpp

index 3f35681..27c5dfa 100644 (file)
@@ -16,7 +16,8 @@
 
 namespace facebook { namespace thrift { namespace concurrency {
 
-using namespace boost;
+using boost::shared_ptr;
+using boost::weak_ptr;
 
 /**
  * The POSIX thread class.
index d8b1e8c..eec94be 100644 (file)
@@ -20,7 +20,8 @@
 
 namespace facebook { namespace thrift { namespace concurrency {
 
-using namespace boost;
+using boost::shared_ptr;
+using boost::dynamic_pointer_cast;
 
 /**
  * ThreadManager class
index 9182da7..ed86000 100644 (file)
@@ -20,7 +20,7 @@
 namespace facebook { namespace thrift { namespace transport { 
 
 using namespace std;
-using namespace boost;
+using boost::shared_ptr;
 
 TServerSocket::TServerSocket(int port) :
   port_(port),