Remove boost::lambda from transportsender.cc

This commit is contained in:
Keegan McAllister
2012-03-14 03:36:43 -04:00
committed by Keith Winstein
parent 8bc9aa33bf
commit 83694977a7
2 changed files with 8 additions and 5 deletions
+4 -5
View File
@@ -16,7 +16,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <boost/lambda/lambda.hpp>
#include <algorithm>
#include <list>
#include <stdio.h>
@@ -26,7 +25,6 @@
#include "transportsender.h"
#include "transportfragment.h"
using namespace boost::lambda;
using namespace Network;
using namespace std;
@@ -312,9 +310,10 @@ void TransportSender<MyState>::process_acknowledgment_through( uint64_t ack_num
{
/* Ignore ack if we have culled the state it's acknowledging */
if ( sent_states.end() != find_if( sent_states.begin(), sent_states.end(),
(&_1)->*&TimestampedState<MyState>::num == ack_num ) ) {
sent_states.remove_if( (&_1)->*&TimestampedState<MyState>::num < ack_num );
if ( sent_states.end() !=
find_if( sent_states.begin(), sent_states.end(),
bind2nd( mem_fun_ref( &TimestampedState<MyState>::num_eq ), ack_num ) ) ) {
sent_states.remove_if( bind2nd( mem_fun_ref( &TimestampedState<MyState>::num_lt ), ack_num ) );
}
assert( !sent_states.empty() );
+4
View File
@@ -31,6 +31,10 @@ namespace Network {
TimestampedState( uint64_t s_timestamp, uint64_t s_num, State &s_state )
: timestamp( s_timestamp ), num( s_num ), state( s_state )
{}
/* For use with find_if, remove_if */
bool num_eq( uint64_t v ) const { return num == v; }
bool num_lt( uint64_t v ) const { return num < v; }
};
}