From dbc9221771e3158336126009aff945e86acca5da Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 22 Dec 2010 09:01:09 +0100 Subject: [PATCH] Do not import full std::tr1 namespace. --- communicator.cpp | 4 ++-- process.cpp | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/communicator.cpp b/communicator.cpp index 1570b10..f3e6bf9 100644 --- a/communicator.cpp +++ b/communicator.cpp @@ -115,8 +115,8 @@ bool communicator::recv(message*& msg, m_host_t& from, bool wait) void communicator::flush(bool wait) { - using namespace std::tr1; - using namespace std::tr1::placeholders; + using std::tr1::bind; + using std::tr1::placeholders::_1; sent_comm.remove_if(comm_test_n_destroy); if (wait && !sent_comm.empty()) { diff --git a/process.cpp b/process.cpp index 8b31678..306687f 100644 --- a/process.cpp +++ b/process.cpp @@ -148,8 +148,9 @@ int process::run() double process::sum_of_to_send() const { - using namespace std::tr1; - using namespace std::tr1::placeholders; + using std::tr1::bind; + using std::tr1::placeholders::_1; + using std::tr1::placeholders::_2; return std::accumulate(neigh.begin(), neigh.end(), 0.0, bind(std::plus(), @@ -218,8 +219,8 @@ void process::send1_bookkeeping(neighbor& nb) void process::send() { - using namespace std::tr1; - using namespace std::tr1::placeholders; + using std::tr1::bind; + using std::tr1::placeholders::_1; if (opt::bookkeeping) { std::for_each(neigh.begin(), neigh.end(), @@ -283,8 +284,8 @@ void process::finalize1(neighbor& nb) void process::finalize() { - using namespace std::tr1; - using namespace std::tr1::placeholders; + using std::tr1::bind; + using std::tr1::placeholders::_1; finalizing = true; total_load_running -= load; @@ -303,8 +304,8 @@ void process::finalize() #define print_loads_generic(vec, verbose, logp, cat) \ if (_XBT_LOG_ISENABLEDV((*cat), logp)) { \ - using namespace std::tr1; \ - using namespace std::tr1::placeholders; \ + using std::tr1::bind; \ + using std::tr1::placeholders::_1; \ XCLOG0(cat, logp, "Neighbor loads:"); \ std::for_each(vec.begin(), vec.end(), \ bind(&neighbor::print, _1, verbose, logp, cat)); \ -- 2.39.5