Thrift: No using namespace.
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
diff --git a/lib/cpp/src/concurrency/PosixThreadFactory.cpp b/lib/cpp/src/concurrency/PosixThreadFactory.cpp
index 3f35681..27c5dfa 100644
--- a/lib/cpp/src/concurrency/PosixThreadFactory.cpp
+++ b/lib/cpp/src/concurrency/PosixThreadFactory.cpp
@@ -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.
diff --git a/lib/cpp/src/concurrency/ThreadManager.cpp b/lib/cpp/src/concurrency/ThreadManager.cpp
index d8b1e8c..eec94be 100644
--- a/lib/cpp/src/concurrency/ThreadManager.cpp
+++ b/lib/cpp/src/concurrency/ThreadManager.cpp
@@ -20,7 +20,8 @@
namespace facebook { namespace thrift { namespace concurrency {
-using namespace boost;
+using boost::shared_ptr;
+using boost::dynamic_pointer_cast;
/**
* ThreadManager class
diff --git a/lib/cpp/src/transport/TServerSocket.cpp b/lib/cpp/src/transport/TServerSocket.cpp
index 9182da7..ed86000 100644
--- a/lib/cpp/src/transport/TServerSocket.cpp
+++ b/lib/cpp/src/transport/TServerSocket.cpp
@@ -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),