Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 8, 2015, 10:40:44 AM (9 years ago)
Author:
landauf
Message:

using std::bind and std::function instead of boost::bind and boost::function respectively. use arg:: namespace for placeholders to avoid ambiguity with boost-placeholders

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/libraries/network/TrafficControl.cc

    r10769 r10775  
    3030
    3131#include <cassert>
    32 #include <boost/bind.hpp>
     32#include <functional>
    3333
    3434#include "core/CoreIncludes.h"
     
    3939
    4040  static const unsigned int SCHED_PRIORITY_OFFSET = static_cast<unsigned int>(-1);
     41  namespace arg = std::placeholders;
    4142
    4243  objInfo::objInfo(uint32_t ID, uint32_t creatorID, int32_t curGsID, int32_t diffGsID, uint32_t size, unsigned int prioperm, unsigned int priosched)
     
    258259
    259260      //sort copied list according to priorities
    260       // use boost bind here because we need to pass a memberfunction to stl sort
    261 //       sort( list.begin(), list.end(), boost::bind(&TrafficControl::prioritySort, this, clientID, _1, _2) );
    262       list.sort( boost::bind(&TrafficControl::prioritySort, this, clientID, _1, _2) );
    263 
    264 //       list.sort(boost::bind(&TrafficControl::prioritySort, this, clientID, _1, _2) );
     261      // use std::bind here because we need to pass a memberfunction to stl sort
     262//       sort( list.begin(), list.end(), std::bind(&TrafficControl::prioritySort, this, clientID, arg::_1, arg::_2) );
     263      list.sort( std::bind(&TrafficControl::prioritySort, this, clientID, arg::_1, arg::_2) );
     264
     265//       list.sort(std::bind(&TrafficControl::prioritySort, this, clientID, arg::_1, arg::_2) );
    265266
    266267      //now we check, that the creator of an object always exists on a client
     
    275276      cut(list, targetSize);
    276277      //now sort again after objDataOffset
    277 //       sort(list.begin(), list.end(), boost::bind(&TrafficControl::dataSort, this, _1, _2) );
    278       list.sort( boost::bind(&TrafficControl::dataSort, this, _1, _2) );
     278//       sort(list.begin(), list.end(), std::bind(&TrafficControl::dataSort, this, arg::_1, arg::_2) );
     279      list.sort( std::bind(&TrafficControl::dataSort, this, arg::_1, arg::_2) );
    279280
    280281      //diese Funktion updateClientList muss noch gemacht werden
Note: See TracChangeset for help on using the changeset viewer.