From: Arnaud Giersch Date: Wed, 22 Dec 2010 08:01:09 +0000 (+0100) Subject: Do not import full std::tr1 namespace. X-Git-Tag: v0.1~205 X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/commitdiff_plain/dbc9221771e3158336126009aff945e86acca5da?ds=sidebyside;hp=cd488767770ec6e9fb9437dcdd589af3fb02fbb7 Do not import full std::tr1 namespace. --- 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)); \