Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Dec 2013 17:03:21 +0100 (CET)
From:      Philip Paeps <philip@FreeBSD.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/185299: [PATCH] Fix net-p2p/rtorrent-devel build with clang on >10.x
Message-ID:  <20131230160321.6918D2A15@rincewind.paeps.cx>
Resent-Message-ID: <201312301610.rBUGA049027842@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         185299
>Category:       ports
>Synopsis:       [PATCH] Fix net-p2p/rtorrent-devel build with clang on >10.x
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 30 16:10:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Philip Paeps
>Release:        FreeBSD 10.0-PRERELEASE amd64
>Organization:
Happily disorganised
>Environment:
System: FreeBSD rincewind.paeps.cx 10.0-PRERELEASE FreeBSD 10.0-PRERELEASE #16 r260042: Sun Dec 29 19:44:44 CET 2013 philip@rincewind:/usr/obj/usr/src/sys/RINCEWIND amd64
>Description:
	The net-p2p/rtorrent-devel port depends on gcc on FreeBSD >10.x to work
	around C++ bugs in the code. It is (fairly) trivial to fix the bugs
	themselves though. The included patch was produced mostly with sed.
>How-To-Repeat:
	Build net-p2p/rtorrent-devel on FreeBSD >10.x
>Fix:
Index: Makefile
===================================================================
--- Makefile	(revision 336929)
+++ Makefile	(working copy)
@@ -38,8 +38,8 @@
 
 # Workaround to build and segfault on > 10.x
 .if ${OPSYS} == "FreeBSD" && ${OSVERSION} >= 1000000
-USE_GCC=	yes
-LDFLAGS+=	-lc++
+CXXFLAGS+=-std=c++11
+EXTRA_PATCHES+=${PATCHDIR}/extra-patch-fix-clang-build.diff
 .endif
 
 .if ${PORT_OPTIONS:MXMLRPC}
Index: files/extra-patch-fix-clang-build.diff
===================================================================
--- files/extra-patch-fix-clang-build.diff	(revision 0)
+++ files/extra-patch-fix-clang-build.diff	(working copy)
@@ -0,0 +1,2355 @@
+--- rak/functional_fun.h
++++ rak/functional_fun.h
+@@ -53,8 +53,8 @@
+ 
+ #include <memory>
+ #include <functional>
+-#include <tr1/functional>
+-#include <tr1/memory>
++#include <functional>
++#include <memory>
+ 
+ namespace rak {
+ 
+@@ -98,13 +98,13 @@ public:
+ 
+   bool                is_valid() const     { return m_base.get() != NULL; }
+ 
+-  void                set(base_type* base) { m_base = std::tr1::shared_ptr<base_type>(base); }
++  void                set(base_type* base) { m_base = std::shared_ptr<base_type>(base); }
+   base_type*          release()            { return m_base.release(); }
+ 
+   Result operator () ()                    { return (*m_base)(); }
+ 
+ private:
+-  std::tr1::shared_ptr<base_type> m_base;
++  std::shared_ptr<base_type> m_base;
+ };
+ 
+ template <typename Result, typename Arg1>
+@@ -115,13 +115,13 @@ public:
+ 
+   bool                is_valid() const     { return m_base.get() != NULL; }
+ 
+-  void                set(base_type* base) { m_base = std::tr1::shared_ptr<base_type>(base); }
++  void                set(base_type* base) { m_base = std::shared_ptr<base_type>(base); }
+   base_type*          release()            { return m_base.release(); }
+ 
+   Result operator () (Arg1 arg1)           { return (*m_base)(arg1); }
+ 
+ private:
+-  std::tr1::shared_ptr<base_type> m_base;
++  std::shared_ptr<base_type> m_base;
+ };
+ 
+ template <typename Result, typename Arg1, typename Arg2>
+@@ -132,13 +132,13 @@ public:
+ 
+   bool                is_valid() const     { return m_base.get() != NULL; }
+ 
+-  void                set(base_type* base) { m_base = std::tr1::shared_ptr<base_type>(base); }
++  void                set(base_type* base) { m_base = std::shared_ptr<base_type>(base); }
+   base_type*          release()            { return m_base.release(); }
+ 
+   Result operator () (Arg1 arg1, Arg2 arg2) { return (*m_base)(arg1, arg2); }
+ 
+ private:
+-  std::tr1::shared_ptr<base_type> m_base;
++  std::shared_ptr<base_type> m_base;
+ };
+ 
+ template <typename Result, typename Arg2>
+@@ -149,7 +149,7 @@ public:
+ 
+   bool                is_valid() const     { return m_base.get() != NULL; }
+ 
+-  void                set(base_type* base) { m_base = std::tr1::shared_ptr<base_type>(base); }
++  void                set(base_type* base) { m_base = std::shared_ptr<base_type>(base); }
+   base_type*          release()            { return m_base.release(); }
+ 
+   Result operator () (Arg2 arg2)           { return (*m_base)(arg2); }
+@@ -158,7 +158,7 @@ public:
+   Result operator () (Discard discard, Arg2 arg2) { return (*m_base)(arg2); }
+ 
+ private:
+-  std::tr1::shared_ptr<base_type> m_base;
++  std::shared_ptr<base_type> m_base;
+ };
+ 
+ template <typename Result, typename Arg1, typename Arg2, typename Arg3>
+@@ -169,13 +169,13 @@ public:
+ 
+   bool                is_valid() const     { return m_base.get() != NULL; }
+ 
+-  void                set(base_type* base) { m_base = std::tr1::shared_ptr<base_type>(base); }
++  void                set(base_type* base) { m_base = std::shared_ptr<base_type>(base); }
+   base_type*          release()            { return m_base.release(); }
+ 
+   Result operator () (Arg1 arg1, Arg2 arg2, Arg3 arg3) { return (*m_base)(arg1, arg2, arg3); }
+ 
+ private:
+-  std::tr1::shared_ptr<base_type> m_base;
++  std::shared_ptr<base_type> m_base;
+ };
+ 
+ template <typename Result>
+--- rak/priority_queue_default.h
++++ rak/priority_queue_default.h
+@@ -37,7 +37,7 @@
+ #ifndef RAK_PRIORITY_QUEUE_DEFAULT_H
+ #define RAK_PRIORITY_QUEUE_DEFAULT_H
+ 
+-#include <tr1/functional>
++#include <functional>
+ #include <rak/allocators.h>
+ #include <rak/priority_queue.h>
+ #include <rak/timer.h>
+@@ -48,7 +48,7 @@ namespace rak {
+ 
+ class priority_item {
+ public:
+-  typedef std::tr1::function<void (void)> slot_void;
++  typedef std::function<void (void)> slot_void;
+ 
+   priority_item() {}
+   ~priority_item() {
+--- src/command_download.cc
++++ src/command_download.cc
+@@ -287,8 +287,8 @@ retrieve_d_bitfield(core::Download* download) {
+ // Just a helper function atm.
+ torrent::Object
+ cmd_d_initialize_logs(core::Download* download) {
+-  download->info()->signal_network_log().push_back(tr1::bind(&core::Manager::push_log_complete, control->core(), tr1::placeholders::_1));
+-  download->info()->signal_storage_error().push_back(tr1::bind(&core::Manager::push_log_complete, control->core(), tr1::placeholders::_1));
++  download->info()->signal_network_log().push_back(std::bind(&core::Manager::push_log_complete, control->core(), std::placeholders::_1));
++  download->info()->signal_storage_error().push_back(std::bind(&core::Manager::push_log_complete, control->core(), std::placeholders::_1));
+ 
+   return torrent::Object();
+ }
+@@ -365,7 +365,7 @@ f_multicall(core::Download* download, const torrent::Object::list_type& args) {
+   if (args.front().is_list())
+     std::transform(args.front().as_list().begin(), args.front().as_list().end(),
+                    std::back_inserter(regex_list),
+-                   tr1::bind(&torrent::Object::as_string_c, tr1::placeholders::_1));
++                   std::bind(&torrent::Object::as_string_c, std::placeholders::_1));
+   else if (args.front().is_string() && !args.front().as_string().empty())
+     regex_list.push_back(args.front().as_string());
+   else
+@@ -374,7 +374,7 @@ f_multicall(core::Download* download, const torrent::Object::list_type& args) {
+   for (torrent::FileList::const_iterator itr = download->file_list()->begin(), last = download->file_list()->end(); itr != last; itr++) {
+     if (use_regex &&
+         std::find_if(regex_list.begin(), regex_list.end(),
+-                     tr1::bind(&rak::regex::operator(), tr1::placeholders::_1, (*itr)->path()->as_string())) == regex_list.end())
++                     std::bind(&rak::regex::operator(), std::placeholders::_1, (*itr)->path()->as_string())) == regex_list.end())
+       continue;
+ 
+     torrent::Object::list_type& row = result.insert(result.end(), torrent::Object::create_list())->as_list();
+@@ -590,52 +590,52 @@ d_list_remove(core::Download* download, const torrent::Object& rawArgs, const ch
+   return torrent::Object();
+ }
+ 
+-#define CMD2_ON_INFO(func) tr1::bind(&torrent::DownloadInfo::func, tr1::bind(&core::Download::info, tr1::placeholders::_1))
+-#define CMD2_ON_DATA(func) tr1::bind(&torrent::download_data::func, tr1::bind(&core::Download::data, tr1::placeholders::_1))
+-#define CMD2_ON_DL(func) tr1::bind(&torrent::Download::func, tr1::bind(&core::Download::download, tr1::placeholders::_1))
+-#define CMD2_ON_FL(func) tr1::bind(&torrent::FileList::func, tr1::bind(&core::Download::file_list, tr1::placeholders::_1))
++#define CMD2_ON_INFO(func) std::bind(&torrent::DownloadInfo::func, std::bind(&core::Download::info, std::placeholders::_1))
++#define CMD2_ON_DATA(func) std::bind(&torrent::download_data::func, std::bind(&core::Download::data, std::placeholders::_1))
++#define CMD2_ON_DL(func) std::bind(&torrent::Download::func, std::bind(&core::Download::download, std::placeholders::_1))
++#define CMD2_ON_FL(func) std::bind(&torrent::FileList::func, std::bind(&core::Download::file_list, std::placeholders::_1))
+ 
+-#define CMD2_BIND_DL tr1::bind(&core::Download::download, tr1::placeholders::_1)
+-#define CMD2_BIND_CL tr1::bind(&core::Download::connection_list, tr1::placeholders::_1)
+-#define CMD2_BIND_FL tr1::bind(&core::Download::file_list, tr1::placeholders::_1)
+-#define CMD2_BIND_PL tr1::bind(&core::Download::c_peer_list, tr1::placeholders::_1)
+-#define CMD2_BIND_TL tr1::bind(&core::Download::tracker_list, tr1::placeholders::_1)
+-#define CMD2_BIND_TC tr1::bind(&core::Download::tracker_controller, tr1::placeholders::_1)
++#define CMD2_BIND_DL std::bind(&core::Download::download, std::placeholders::_1)
++#define CMD2_BIND_CL std::bind(&core::Download::connection_list, std::placeholders::_1)
++#define CMD2_BIND_FL std::bind(&core::Download::file_list, std::placeholders::_1)
++#define CMD2_BIND_PL std::bind(&core::Download::c_peer_list, std::placeholders::_1)
++#define CMD2_BIND_TL std::bind(&core::Download::tracker_list, std::placeholders::_1)
++#define CMD2_BIND_TC std::bind(&core::Download::tracker_controller, std::placeholders::_1)
+ 
+-#define CMD2_BIND_INFO tr1::bind(&core::Download::info, tr1::placeholders::_1)
+-#define CMD2_BIND_DATA tr1::bind(&core::Download::data, tr1::placeholders::_1)
++#define CMD2_BIND_INFO std::bind(&core::Download::info, std::placeholders::_1)
++#define CMD2_BIND_DATA std::bind(&core::Download::data, std::placeholders::_1)
+ 
+ #define CMD2_DL_VAR_VALUE(key, first_key, second_key)                   \
+-  CMD2_DL(key, tr1::bind(&download_get_variable, tr1::placeholders::_1, first_key, second_key)); \
+-  CMD2_DL_VALUE_P(key ".set", tr1::bind(&download_set_variable_value, \
+-                                             tr1::placeholders::_1, tr1::placeholders::_2, \
++  CMD2_DL(key, std::bind(&download_get_variable, std::placeholders::_1, first_key, second_key)); \
++  CMD2_DL_VALUE_P(key ".set", std::bind(&download_set_variable_value, \
++                                             std::placeholders::_1, std::placeholders::_2, \
+                                              first_key, second_key));
+ 
+ #define CMD2_DL_VAR_VALUE_PUBLIC(key, first_key, second_key)            \
+-  CMD2_DL(key, tr1::bind(&download_get_variable, tr1::placeholders::_1, first_key, second_key)); \
+-  CMD2_DL_VALUE(key ".set", tr1::bind(&download_set_variable_value, \
+-                                           tr1::placeholders::_1, tr1::placeholders::_2, \
++  CMD2_DL(key, std::bind(&download_get_variable, std::placeholders::_1, first_key, second_key)); \
++  CMD2_DL_VALUE(key ".set", std::bind(&download_set_variable_value, \
++                                           std::placeholders::_1, std::placeholders::_2, \
+                                            first_key, second_key));
+ 
+ #define CMD2_DL_TIMESTAMP(key, first_key, second_key)                   \
+-  CMD2_DL(key, tr1::bind(&download_get_variable, tr1::placeholders::_1, first_key, second_key)); \
+-  CMD2_DL_VALUE_P(key ".set", tr1::bind(&download_set_variable_value, \
+-                                             tr1::placeholders::_1, tr1::placeholders::_2, \
++  CMD2_DL(key, std::bind(&download_get_variable, std::placeholders::_1, first_key, second_key)); \
++  CMD2_DL_VALUE_P(key ".set", std::bind(&download_set_variable_value, \
++                                             std::placeholders::_1, std::placeholders::_2, \
+                                              first_key, second_key)); \
+-  CMD2_DL_VALUE_P(key ".set_if_z", tr1::bind(&download_set_variable_value_ifz, \
+-                                             tr1::placeholders::_1, tr1::placeholders::_2, \
++  CMD2_DL_VALUE_P(key ".set_if_z", std::bind(&download_set_variable_value_ifz, \
++                                             std::placeholders::_1, std::placeholders::_2, \
+                                              first_key, second_key));   \
+ 
+ #define CMD2_DL_VAR_STRING(key, first_key, second_key)                   \
+-  CMD2_DL(key, tr1::bind(&download_get_variable, tr1::placeholders::_1, first_key, second_key)); \
+-  CMD2_DL_STRING_P(key ".set", tr1::bind(&download_set_variable_string, \
+-                                              tr1::placeholders::_1, tr1::placeholders::_2, \
++  CMD2_DL(key, std::bind(&download_get_variable, std::placeholders::_1, first_key, second_key)); \
++  CMD2_DL_STRING_P(key ".set", std::bind(&download_set_variable_string, \
++                                              std::placeholders::_1, std::placeholders::_2, \
+                                               first_key, second_key));
+ 
+ #define CMD2_DL_VAR_STRING_PUBLIC(key, first_key, second_key)                   \
+-  CMD2_DL(key, tr1::bind(&download_get_variable, tr1::placeholders::_1, first_key, second_key)); \
+-  CMD2_DL_STRING(key ".set", tr1::bind(&download_set_variable_string, \
+-                                            tr1::placeholders::_1, tr1::placeholders::_2, \
++  CMD2_DL(key, std::bind(&download_get_variable, std::placeholders::_1, first_key, second_key)); \
++  CMD2_DL_STRING(key ".set", std::bind(&download_set_variable_string, \
++                                            std::placeholders::_1, std::placeholders::_2, \
+                                             first_key, second_key));
+ 
+ int64_t            cg_d_group(core::Download* download);
+@@ -644,12 +644,12 @@ void               cg_d_group_set(core::Download* download, const torrent::Objec
+ 
+ void
+ initialize_command_download() {
+-  CMD2_DL("d.hash",          tr1::bind(&rak::transform_hex_str<torrent::HashString>, CMD2_ON_INFO(hash)));
+-  CMD2_DL("d.local_id",      tr1::bind(&rak::transform_hex_str<torrent::HashString>, CMD2_ON_INFO(local_id)));
+-  CMD2_DL("d.local_id_html", tr1::bind(&rak::copy_escape_html_str<torrent::HashString>, CMD2_ON_INFO(local_id)));
+-  CMD2_DL("d.bitfield",      tr1::bind(&retrieve_d_bitfield, tr1::placeholders::_1));
+-  CMD2_DL("d.base_path",     tr1::bind(&retrieve_d_base_path, tr1::placeholders::_1));
+-  CMD2_DL("d.base_filename", tr1::bind(&retrieve_d_base_filename, tr1::placeholders::_1));
++  CMD2_DL("d.hash",          std::bind(&rak::transform_hex_str<torrent::HashString>, CMD2_ON_INFO(hash)));
++  CMD2_DL("d.local_id",      std::bind(&rak::transform_hex_str<torrent::HashString>, CMD2_ON_INFO(local_id)));
++  CMD2_DL("d.local_id_html", std::bind(&rak::copy_escape_html_str<torrent::HashString>, CMD2_ON_INFO(local_id)));
++  CMD2_DL("d.bitfield",      std::bind(&retrieve_d_bitfield, std::placeholders::_1));
++  CMD2_DL("d.base_path",     std::bind(&retrieve_d_base_path, std::placeholders::_1));
++  CMD2_DL("d.base_filename", std::bind(&retrieve_d_base_filename, std::placeholders::_1));
+ 
+   CMD2_DL("d.name",          CMD2_ON_INFO(name));
+   CMD2_DL("d.creation_date", CMD2_ON_INFO(creation_date));
+@@ -659,19 +659,19 @@ initialize_command_download() {
+   // Network related:
+   //
+ 
+-  CMD2_DL         ("d.up.rate",       tr1::bind(&torrent::Rate::rate,  CMD2_ON_INFO(up_rate)));
+-  CMD2_DL         ("d.up.total",      tr1::bind(&torrent::Rate::total, CMD2_ON_INFO(up_rate)));
+-  CMD2_DL         ("d.down.rate",     tr1::bind(&torrent::Rate::rate,  CMD2_ON_INFO(down_rate)));
+-  CMD2_DL         ("d.down.total",    tr1::bind(&torrent::Rate::total, CMD2_ON_INFO(down_rate)));
+-  CMD2_DL         ("d.skip.rate",     tr1::bind(&torrent::Rate::rate,  CMD2_ON_INFO(skip_rate)));
+-  CMD2_DL         ("d.skip.total",    tr1::bind(&torrent::Rate::total, CMD2_ON_INFO(skip_rate)));
++  CMD2_DL         ("d.up.rate",       std::bind(&torrent::Rate::rate,  CMD2_ON_INFO(up_rate)));
++  CMD2_DL         ("d.up.total",      std::bind(&torrent::Rate::total, CMD2_ON_INFO(up_rate)));
++  CMD2_DL         ("d.down.rate",     std::bind(&torrent::Rate::rate,  CMD2_ON_INFO(down_rate)));
++  CMD2_DL         ("d.down.total",    std::bind(&torrent::Rate::total, CMD2_ON_INFO(down_rate)));
++  CMD2_DL         ("d.skip.rate",     std::bind(&torrent::Rate::rate,  CMD2_ON_INFO(skip_rate)));
++  CMD2_DL         ("d.skip.total",    std::bind(&torrent::Rate::total, CMD2_ON_INFO(skip_rate)));
+ 
+   CMD2_DL         ("d.peer_exchange",     CMD2_ON_INFO(is_pex_enabled));
+-  CMD2_DL_VALUE_V ("d.peer_exchange.set", tr1::bind(&torrent::Download::set_pex_enabled, CMD2_BIND_DL, tr1::placeholders::_2));
++  CMD2_DL_VALUE_V ("d.peer_exchange.set", std::bind(&torrent::Download::set_pex_enabled, CMD2_BIND_DL, std::placeholders::_2));
+ 
+-  CMD2_DL_LIST    ("d.create_link", tr1::bind(&apply_d_change_link, tr1::placeholders::_1, tr1::placeholders::_2, 0));
+-  CMD2_DL_LIST    ("d.delete_link", tr1::bind(&apply_d_change_link, tr1::placeholders::_1, tr1::placeholders::_2, 1));
+-  CMD2_DL         ("d.delete_tied", tr1::bind(&apply_d_delete_tied, tr1::placeholders::_1));
++  CMD2_DL_LIST    ("d.create_link", std::bind(&apply_d_change_link, std::placeholders::_1, std::placeholders::_2, 0));
++  CMD2_DL_LIST    ("d.delete_link", std::bind(&apply_d_change_link, std::placeholders::_1, std::placeholders::_2, 1));
++  CMD2_DL         ("d.delete_tied", std::bind(&apply_d_delete_tied, std::placeholders::_1));
+ 
+   CMD2_FUNC_SINGLE("d.start",     "d.hashing_failed.set=0 ;view.set_visible=started");
+   CMD2_FUNC_SINGLE("d.stop",      "view.set_visible=stopped");
+@@ -685,36 +685,36 @@ initialize_command_download() {
+ 
+   CMD2_DL         ("d.is_open",               CMD2_ON_INFO(is_open));
+   CMD2_DL         ("d.is_active",             CMD2_ON_INFO(is_active));
+-  CMD2_DL         ("d.is_hash_checked",       tr1::bind(&torrent::Download::is_hash_checked, CMD2_BIND_DL));
+-  CMD2_DL         ("d.is_hash_checking",      tr1::bind(&torrent::Download::is_hash_checking, CMD2_BIND_DL));
+-  CMD2_DL         ("d.is_multi_file",         tr1::bind(&torrent::FileList::is_multi_file, CMD2_BIND_FL));
++  CMD2_DL         ("d.is_hash_checked",       std::bind(&torrent::Download::is_hash_checked, CMD2_BIND_DL));
++  CMD2_DL         ("d.is_hash_checking",      std::bind(&torrent::Download::is_hash_checking, CMD2_BIND_DL));
++  CMD2_DL         ("d.is_multi_file",         std::bind(&torrent::FileList::is_multi_file, CMD2_BIND_FL));
+   CMD2_DL         ("d.is_private",            CMD2_ON_INFO(is_private));
+   CMD2_DL         ("d.is_pex_active",         CMD2_ON_INFO(is_pex_active));
+   CMD2_DL         ("d.is_partially_done",     CMD2_ON_DATA(is_partially_done));
+   CMD2_DL         ("d.is_not_partially_done", CMD2_ON_DATA(is_not_partially_done));
+ 
+-  CMD2_DL_V       ("d.resume",     tr1::bind(&core::DownloadList::resume_default, control->core()->download_list(), tr1::placeholders::_1));
+-  CMD2_DL_V       ("d.pause",      tr1::bind(&core::DownloadList::pause_default, control->core()->download_list(), tr1::placeholders::_1));
+-  CMD2_DL_V       ("d.open",       tr1::bind(&core::DownloadList::open_throw, control->core()->download_list(), tr1::placeholders::_1));
+-  CMD2_DL_V       ("d.close",      tr1::bind(&core::DownloadList::close_throw, control->core()->download_list(), tr1::placeholders::_1));
+-  CMD2_DL_V       ("d.close.directly", tr1::bind(&core::DownloadList::close_directly, control->core()->download_list(), tr1::placeholders::_1));
+-  CMD2_DL_V       ("d.erase",      tr1::bind(&core::DownloadList::erase_ptr, control->core()->download_list(), tr1::placeholders::_1));
+-  CMD2_DL_V       ("d.check_hash", tr1::bind(&core::DownloadList::check_hash, control->core()->download_list(), tr1::placeholders::_1));
++  CMD2_DL_V       ("d.resume",     std::bind(&core::DownloadList::resume_default, control->core()->download_list(), std::placeholders::_1));
++  CMD2_DL_V       ("d.pause",      std::bind(&core::DownloadList::pause_default, control->core()->download_list(), std::placeholders::_1));
++  CMD2_DL_V       ("d.open",       std::bind(&core::DownloadList::open_throw, control->core()->download_list(), std::placeholders::_1));
++  CMD2_DL_V       ("d.close",      std::bind(&core::DownloadList::close_throw, control->core()->download_list(), std::placeholders::_1));
++  CMD2_DL_V       ("d.close.directly", std::bind(&core::DownloadList::close_directly, control->core()->download_list(), std::placeholders::_1));
++  CMD2_DL_V       ("d.erase",      std::bind(&core::DownloadList::erase_ptr, control->core()->download_list(), std::placeholders::_1));
++  CMD2_DL_V       ("d.check_hash", std::bind(&core::DownloadList::check_hash, control->core()->download_list(), std::placeholders::_1));
+ 
+-  CMD2_DL         ("d.save_resume",       tr1::bind(&core::DownloadStore::save_resume, control->core()->download_store(), tr1::placeholders::_1));
+-  CMD2_DL         ("d.save_full_session", tr1::bind(&core::DownloadStore::save_full, control->core()->download_store(), tr1::placeholders::_1));
++  CMD2_DL         ("d.save_resume",       std::bind(&core::DownloadStore::save_resume, control->core()->download_store(), std::placeholders::_1));
++  CMD2_DL         ("d.save_full_session", std::bind(&core::DownloadStore::save_full, control->core()->download_store(), std::placeholders::_1));
+ 
+   CMD2_DL_V       ("d.update_priorities", CMD2_ON_DL(update_priorities));
+ 
+-  CMD2_DL_STRING_V("add_peer",   tr1::bind(&apply_d_add_peer, tr1::placeholders::_1, tr1::placeholders::_2));
++  CMD2_DL_STRING_V("add_peer",   std::bind(&apply_d_add_peer, std::placeholders::_1, std::placeholders::_2));
+ 
+   //
+   // Custom settings:
+   //
+ 
+-  CMD2_DL_STRING("d.custom",       tr1::bind(&retrieve_d_custom, tr1::placeholders::_1, tr1::placeholders::_2));
+-  CMD2_DL_STRING("d.custom_throw", tr1::bind(&retrieve_d_custom_throw, tr1::placeholders::_1, tr1::placeholders::_2));
+-  CMD2_DL_LIST  ("d.custom.set",   tr1::bind(&apply_d_custom, tr1::placeholders::_1, tr1::placeholders::_2));
++  CMD2_DL_STRING("d.custom",       std::bind(&retrieve_d_custom, std::placeholders::_1, std::placeholders::_2));
++  CMD2_DL_STRING("d.custom_throw", std::bind(&retrieve_d_custom_throw, std::placeholders::_1, std::placeholders::_2));
++  CMD2_DL_LIST  ("d.custom.set",   std::bind(&apply_d_custom, std::placeholders::_1, std::placeholders::_2));
+ 
+   CMD2_DL_VAR_STRING_PUBLIC("d.custom1", "rtorrent", "custom1");
+   CMD2_DL_VAR_STRING_PUBLIC("d.custom2", "rtorrent", "custom2");
+@@ -759,68 +759,68 @@ initialize_command_download() {
+   CMD2_DL_TIMESTAMP("d.timestamp.started",      "rtorrent", "timestamp.started");
+   CMD2_DL_TIMESTAMP("d.timestamp.finished",     "rtorrent", "timestamp.finished");
+ 
+-  CMD2_DL       ("d.connection_current",     tr1::bind(&torrent::option_as_string, torrent::OPTION_CONNECTION_TYPE, CMD2_ON_DL(connection_type)));
+-  CMD2_DL_STRING("d.connection_current.set", tr1::bind(&apply_d_connection_type, tr1::placeholders::_1, tr1::placeholders::_2));
++  CMD2_DL       ("d.connection_current",     std::bind(&torrent::option_as_string, torrent::OPTION_CONNECTION_TYPE, CMD2_ON_DL(connection_type)));
++  CMD2_DL_STRING("d.connection_current.set", std::bind(&apply_d_connection_type, std::placeholders::_1, std::placeholders::_2));
+ 
+   CMD2_DL_VAR_STRING("d.connection_leech",      "rtorrent", "connection_leech");
+   CMD2_DL_VAR_STRING("d.connection_seed",       "rtorrent", "connection_seed");
+ 
+-  CMD2_DL       ("d.up.choke_heuristics",       tr1::bind(&torrent::option_as_string, torrent::OPTION_CHOKE_HEURISTICS, CMD2_ON_DL(upload_choke_heuristic)));
+-  CMD2_DL_STRING("d.up.choke_heuristics.set",   tr1::bind(&apply_d_choke_heuristics, tr1::placeholders::_1, tr1::placeholders::_2, false));
+-  CMD2_DL       ("d.down.choke_heuristics",     tr1::bind(&torrent::option_as_string, torrent::OPTION_CHOKE_HEURISTICS, CMD2_ON_DL(download_choke_heuristic)));
+-  CMD2_DL_STRING("d.down.choke_heuristics.set", tr1::bind(&apply_d_choke_heuristics, tr1::placeholders::_1, tr1::placeholders::_2, true));
++  CMD2_DL       ("d.up.choke_heuristics",       std::bind(&torrent::option_as_string, torrent::OPTION_CHOKE_HEURISTICS, CMD2_ON_DL(upload_choke_heuristic)));
++  CMD2_DL_STRING("d.up.choke_heuristics.set",   std::bind(&apply_d_choke_heuristics, std::placeholders::_1, std::placeholders::_2, false));
++  CMD2_DL       ("d.down.choke_heuristics",     std::bind(&torrent::option_as_string, torrent::OPTION_CHOKE_HEURISTICS, CMD2_ON_DL(download_choke_heuristic)));
++  CMD2_DL_STRING("d.down.choke_heuristics.set", std::bind(&apply_d_choke_heuristics, std::placeholders::_1, std::placeholders::_2, true));
+ 
+   CMD2_DL_VAR_STRING("d.up.choke_heuristics.leech", "rtorrent", "choke_heuristics.up.leech");
+   CMD2_DL_VAR_STRING("d.up.choke_heuristics.seed",  "rtorrent", "choke_heuristics.up.seed");
+   CMD2_DL_VAR_STRING("d.down.choke_heuristics.leech", "rtorrent", "choke_heuristics.down.leech");
+   CMD2_DL_VAR_STRING("d.down.choke_heuristics.seed",  "rtorrent", "choke_heuristics.down.seed");
+ 
+-  CMD2_DL         ("d.hashing_failed",     tr1::bind(&core::Download::is_hash_failed, tr1::placeholders::_1));
+-  CMD2_DL_VALUE_V ("d.hashing_failed.set", tr1::bind(&core::Download::set_hash_failed, tr1::placeholders::_1, tr1::placeholders::_2));
++  CMD2_DL         ("d.hashing_failed",     std::bind(&core::Download::is_hash_failed, std::placeholders::_1));
++  CMD2_DL_VALUE_V ("d.hashing_failed.set", std::bind(&core::Download::set_hash_failed, std::placeholders::_1, std::placeholders::_2));
+ 
+-  CMD2_DL         ("d.views",                  tr1::bind(&download_get_variable, tr1::placeholders::_1, "rtorrent", "views"));
+-  CMD2_DL         ("d.views.has",              tr1::bind(&d_list_has, tr1::placeholders::_1, tr1::placeholders::_2, "rtorrent", "views"));
+-  CMD2_DL         ("d.views.remove",           tr1::bind(&d_list_remove, tr1::placeholders::_1, tr1::placeholders::_2, "rtorrent", "views"));
+-  CMD2_DL         ("d.views.push_back",        tr1::bind(&d_list_push_back, tr1::placeholders::_1, tr1::placeholders::_2, "rtorrent", "views"));
+-  CMD2_DL         ("d.views.push_back_unique", tr1::bind(&d_list_push_back_unique, tr1::placeholders::_1, tr1::placeholders::_2, "rtorrent", "views"));
++  CMD2_DL         ("d.views",                  std::bind(&download_get_variable, std::placeholders::_1, "rtorrent", "views"));
++  CMD2_DL         ("d.views.has",              std::bind(&d_list_has, std::placeholders::_1, std::placeholders::_2, "rtorrent", "views"));
++  CMD2_DL         ("d.views.remove",           std::bind(&d_list_remove, std::placeholders::_1, std::placeholders::_2, "rtorrent", "views"));
++  CMD2_DL         ("d.views.push_back",        std::bind(&d_list_push_back, std::placeholders::_1, std::placeholders::_2, "rtorrent", "views"));
++  CMD2_DL         ("d.views.push_back_unique", std::bind(&d_list_push_back_unique, std::placeholders::_1, std::placeholders::_2, "rtorrent", "views"));
+ 
+   // This command really needs to be improved, so we have proper
+   // logging support.
+-  CMD2_DL         ("d.message",     tr1::bind(&core::Download::message, tr1::placeholders::_1));
+-  CMD2_DL_STRING_V("d.message.set", tr1::bind(&core::Download::set_message, tr1::placeholders::_1, tr1::placeholders::_2));
++  CMD2_DL         ("d.message",     std::bind(&core::Download::message, std::placeholders::_1));
++  CMD2_DL_STRING_V("d.message.set", std::bind(&core::Download::set_message, std::placeholders::_1, std::placeholders::_2));
+ 
+   CMD2_DL         ("d.max_file_size",       CMD2_ON_FL(max_file_size));
+-  CMD2_DL_VALUE_V ("d.max_file_size.set",   tr1::bind(&torrent::FileList::set_max_file_size, CMD2_BIND_FL, tr1::placeholders::_2));
+-
+-  CMD2_DL         ("d.peers_min",           tr1::bind(&torrent::ConnectionList::min_size, CMD2_BIND_CL));
+-  CMD2_DL_VALUE_V ("d.peers_min.set",       tr1::bind(&torrent::ConnectionList::set_min_size, CMD2_BIND_CL, tr1::placeholders::_2));
+-  CMD2_DL         ("d.peers_max",           tr1::bind(&torrent::ConnectionList::max_size, CMD2_BIND_CL));
+-  CMD2_DL_VALUE_V ("d.peers_max.set",       tr1::bind(&torrent::ConnectionList::set_max_size, CMD2_BIND_CL, tr1::placeholders::_2));
+-  CMD2_DL         ("d.uploads_max",         tr1::bind(&torrent::Download::uploads_max, CMD2_BIND_DL));
+-  CMD2_DL_VALUE_V ("d.uploads_max.set",     tr1::bind(&torrent::Download::set_uploads_max, CMD2_BIND_DL, tr1::placeholders::_2));
+-  CMD2_DL         ("d.uploads_min",         tr1::bind(&torrent::Download::uploads_min, CMD2_BIND_DL));
+-  CMD2_DL_VALUE_V ("d.uploads_min.set",     tr1::bind(&torrent::Download::set_uploads_min, CMD2_BIND_DL, tr1::placeholders::_2));
+-  CMD2_DL         ("d.downloads_max",         tr1::bind(&torrent::Download::downloads_max, CMD2_BIND_DL));
+-  CMD2_DL_VALUE_V ("d.downloads_max.set",     tr1::bind(&torrent::Download::set_downloads_max, CMD2_BIND_DL, tr1::placeholders::_2));
+-  CMD2_DL         ("d.downloads_min",         tr1::bind(&torrent::Download::downloads_min, CMD2_BIND_DL));
+-  CMD2_DL_VALUE_V ("d.downloads_min.set",     tr1::bind(&torrent::Download::set_downloads_min, CMD2_BIND_DL, tr1::placeholders::_2));
+-  CMD2_DL         ("d.peers_connected",     tr1::bind(&torrent::ConnectionList::size, CMD2_BIND_CL));
+-  CMD2_DL         ("d.peers_not_connected", tr1::bind(&torrent::PeerList::available_list_size, CMD2_BIND_PL));
++  CMD2_DL_VALUE_V ("d.max_file_size.set",   std::bind(&torrent::FileList::set_max_file_size, CMD2_BIND_FL, std::placeholders::_2));
++
++  CMD2_DL         ("d.peers_min",           std::bind(&torrent::ConnectionList::min_size, CMD2_BIND_CL));
++  CMD2_DL_VALUE_V ("d.peers_min.set",       std::bind(&torrent::ConnectionList::set_min_size, CMD2_BIND_CL, std::placeholders::_2));
++  CMD2_DL         ("d.peers_max",           std::bind(&torrent::ConnectionList::max_size, CMD2_BIND_CL));
++  CMD2_DL_VALUE_V ("d.peers_max.set",       std::bind(&torrent::ConnectionList::set_max_size, CMD2_BIND_CL, std::placeholders::_2));
++  CMD2_DL         ("d.uploads_max",         std::bind(&torrent::Download::uploads_max, CMD2_BIND_DL));
++  CMD2_DL_VALUE_V ("d.uploads_max.set",     std::bind(&torrent::Download::set_uploads_max, CMD2_BIND_DL, std::placeholders::_2));
++  CMD2_DL         ("d.uploads_min",         std::bind(&torrent::Download::uploads_min, CMD2_BIND_DL));
++  CMD2_DL_VALUE_V ("d.uploads_min.set",     std::bind(&torrent::Download::set_uploads_min, CMD2_BIND_DL, std::placeholders::_2));
++  CMD2_DL         ("d.downloads_max",         std::bind(&torrent::Download::downloads_max, CMD2_BIND_DL));
++  CMD2_DL_VALUE_V ("d.downloads_max.set",     std::bind(&torrent::Download::set_downloads_max, CMD2_BIND_DL, std::placeholders::_2));
++  CMD2_DL         ("d.downloads_min",         std::bind(&torrent::Download::downloads_min, CMD2_BIND_DL));
++  CMD2_DL_VALUE_V ("d.downloads_min.set",     std::bind(&torrent::Download::set_downloads_min, CMD2_BIND_DL, std::placeholders::_2));
++  CMD2_DL         ("d.peers_connected",     std::bind(&torrent::ConnectionList::size, CMD2_BIND_CL));
++  CMD2_DL         ("d.peers_not_connected", std::bind(&torrent::PeerList::available_list_size, CMD2_BIND_PL));
+ 
+   CMD2_DL         ("d.peers_complete",      CMD2_ON_DL(peers_complete));
+   CMD2_DL         ("d.peers_accounted",     CMD2_ON_DL(peers_accounted));
+ 
+-  CMD2_DL_V       ("d.disconnect.seeders",        tr1::bind(&torrent::ConnectionList::erase_seeders, CMD2_BIND_CL));
++  CMD2_DL_V       ("d.disconnect.seeders",        std::bind(&torrent::ConnectionList::erase_seeders, CMD2_BIND_CL));
+ 
+   CMD2_DL         ("d.accepting_seeders",         CMD2_ON_INFO(is_accepting_seeders));
+-  CMD2_DL_V       ("d.accepting_seeders.enable",  tr1::bind(&torrent::DownloadInfo::public_set_flags,   CMD2_BIND_INFO, torrent::DownloadInfo::flag_accepting_seeders));
+-  CMD2_DL_V       ("d.accepting_seeders.disable", tr1::bind(&torrent::DownloadInfo::public_unset_flags, CMD2_BIND_INFO, torrent::DownloadInfo::flag_accepting_seeders));
++  CMD2_DL_V       ("d.accepting_seeders.enable",  std::bind(&torrent::DownloadInfo::public_set_flags,   CMD2_BIND_INFO, (1<<4)));
++  CMD2_DL_V       ("d.accepting_seeders.disable", std::bind(&torrent::DownloadInfo::public_unset_flags, CMD2_BIND_INFO, (1<<4)));
+ 
+-  CMD2_DL         ("d.throttle_name",     tr1::bind(&download_get_variable, tr1::placeholders::_1, "rtorrent", "throttle_name"));
+-  CMD2_DL_STRING_V("d.throttle_name.set", tr1::bind(&core::Download::set_throttle_name, tr1::placeholders::_1, tr1::placeholders::_2));
++  CMD2_DL         ("d.throttle_name",     std::bind(&download_get_variable, std::placeholders::_1, "rtorrent", "throttle_name"));
++  CMD2_DL_STRING_V("d.throttle_name.set", std::bind(&core::Download::set_throttle_name, std::placeholders::_1, std::placeholders::_2));
+ 
+   CMD2_DL         ("d.bytes_done",     CMD2_ON_DL(bytes_done));
+-  CMD2_DL         ("d.ratio",          tr1::bind(&retrieve_d_ratio, tr1::placeholders::_1));
++  CMD2_DL         ("d.ratio",          std::bind(&retrieve_d_ratio, std::placeholders::_1));
+   CMD2_DL         ("d.chunks_hashed",  CMD2_ON_DL(chunks_hashed));
+   CMD2_DL         ("d.free_diskspace", CMD2_ON_FL(free_diskspace));
+ 
+@@ -831,7 +831,7 @@ initialize_command_download() {
+   CMD2_DL         ("d.size_pex",       CMD2_ON_DL(size_pex));
+   CMD2_DL         ("d.max_size_pex",   CMD2_ON_DL(max_size_pex));
+ 
+-  CMD2_DL         ("d.chunks_seen",      tr1::bind(&d_chunks_seen, tr1::placeholders::_1));
++  CMD2_DL         ("d.chunks_seen",      std::bind(&d_chunks_seen, std::placeholders::_1));
+ 
+   CMD2_DL         ("d.completed_bytes",  CMD2_ON_FL(completed_bytes));
+   CMD2_DL         ("d.completed_chunks", CMD2_ON_FL(completed_chunks));
+@@ -839,44 +839,44 @@ initialize_command_download() {
+ 
+   CMD2_DL         ("d.wanted_chunks",    CMD2_ON_DATA(wanted_chunks));
+ 
+-  CMD2_DL_V       ("d.tracker_announce",     tr1::bind(&torrent::Download::manual_request, CMD2_BIND_DL, false)); 
+-  CMD2_DL         ("d.tracker_numwant",      tr1::bind(&torrent::TrackerList::numwant, CMD2_BIND_TL));
+-  CMD2_DL_VALUE_V ("d.tracker_numwant.set",  tr1::bind(&torrent::TrackerList::set_numwant, CMD2_BIND_TL, tr1::placeholders::_2));
++  CMD2_DL_V       ("d.tracker_announce",     std::bind(&torrent::Download::manual_request, CMD2_BIND_DL, false)); 
++  CMD2_DL         ("d.tracker_numwant",      std::bind(&torrent::TrackerList::numwant, CMD2_BIND_TL));
++  CMD2_DL_VALUE_V ("d.tracker_numwant.set",  std::bind(&torrent::TrackerList::set_numwant, CMD2_BIND_TL, std::placeholders::_2));
+   // TODO: Deprecate 'd.tracker_focus'.
+-  CMD2_DL         ("d.tracker_focus",        tr1::bind(&core::Download::tracker_list_size, tr1::placeholders::_1));
+-  CMD2_DL         ("d.tracker_size",         tr1::bind(&core::Download::tracker_list_size, tr1::placeholders::_1));
++  CMD2_DL         ("d.tracker_focus",        std::bind(&core::Download::tracker_list_size, std::placeholders::_1));
++  CMD2_DL         ("d.tracker_size",         std::bind(&core::Download::tracker_list_size, std::placeholders::_1));
+ 
+-  CMD2_DL_LIST    ("d.tracker.insert",       tr1::bind(&download_tracker_insert, tr1::placeholders::_1, tr1::placeholders::_2));
+-  CMD2_DL_VALUE_V ("d.tracker.send_scrape",  tr1::bind(&torrent::TrackerController::scrape_request, CMD2_BIND_TC, tr1::placeholders::_2));
++  CMD2_DL_LIST    ("d.tracker.insert",       std::bind(&download_tracker_insert, std::placeholders::_1, std::placeholders::_2));
++  CMD2_DL_VALUE_V ("d.tracker.send_scrape",  std::bind(&torrent::TrackerController::scrape_request, CMD2_BIND_TC, std::placeholders::_2));
+ 
+   CMD2_DL         ("d.directory",          CMD2_ON_FL(root_dir));
+-  CMD2_DL_STRING_V("d.directory.set",      tr1::bind(&apply_d_directory, tr1::placeholders::_1, tr1::placeholders::_2));
++  CMD2_DL_STRING_V("d.directory.set",      std::bind(&apply_d_directory, std::placeholders::_1, std::placeholders::_2));
+   CMD2_DL         ("d.directory_base",     CMD2_ON_FL(root_dir));
+-  CMD2_DL_STRING_V("d.directory_base.set", tr1::bind(&core::Download::set_root_directory, tr1::placeholders::_1, tr1::placeholders::_2));
++  CMD2_DL_STRING_V("d.directory_base.set", std::bind(&core::Download::set_root_directory, std::placeholders::_1, std::placeholders::_2));
+ 
+-  CMD2_DL         ("d.priority",     tr1::bind(&core::Download::priority, tr1::placeholders::_1));
+-  CMD2_DL         ("d.priority_str", tr1::bind(&retrieve_d_priority_str, tr1::placeholders::_1));
+-  CMD2_DL_VALUE_V ("d.priority.set", tr1::bind(&core::Download::set_priority, tr1::placeholders::_1, tr1::placeholders::_2));
++  CMD2_DL         ("d.priority",     std::bind(&core::Download::priority, std::placeholders::_1));
++  CMD2_DL         ("d.priority_str", std::bind(&retrieve_d_priority_str, std::placeholders::_1));
++  CMD2_DL_VALUE_V ("d.priority.set", std::bind(&core::Download::set_priority, std::placeholders::_1, std::placeholders::_2));
+ 
+-  // CMD2_DL         ("d.group",     tr1::bind(&torrent::resource_manager_entry::group,
+-  //                                           tr1::bind(&torrent::ResourceManager::entry_at, torrent::resource_manager(),
+-  //                                                     tr1::bind(&core::Download::main, tr1::placeholders::_1))));
++  // CMD2_DL         ("d.group",     std::bind(&torrent::resource_manager_entry::group,
++  //                                           std::bind(&torrent::ResourceManager::entry_at, torrent::resource_manager(),
++  //                                                     std::bind(&core::Download::main, std::placeholders::_1))));
+ 
+-  // CMD2_DL_V       ("d.group.set", tr1::bind(&torrent::ResourceManager::set_group,
++  // CMD2_DL_V       ("d.group.set", std::bind(&torrent::ResourceManager::set_group,
+   //                                           torrent::resource_manager(),
+-  //                                           tr1::bind(&torrent::ResourceManager::find_throw, torrent::resource_manager(),
+-  //                                                     tr1::bind(&core::Download::main, tr1::placeholders::_1)),
++  //                                           std::bind(&torrent::ResourceManager::find_throw, torrent::resource_manager(),
++  //                                                     std::bind(&core::Download::main, std::placeholders::_1)),
+   //                                           CG_GROUP_INDEX()));
+ 
+-  CMD2_DL         ("d.group",      tr1::bind(&cg_d_group, tr1::placeholders::_1));
+-  CMD2_DL         ("d.group.name", tr1::bind(&cg_d_group, tr1::placeholders::_1));
+-  CMD2_DL_V       ("d.group.set",  tr1::bind(&cg_d_group_set, tr1::placeholders::_1, tr1::placeholders::_2));
++  CMD2_DL         ("d.group",      std::bind(&cg_d_group, std::placeholders::_1));
++  CMD2_DL         ("d.group.name", std::bind(&cg_d_group, std::placeholders::_1));
++  CMD2_DL_V       ("d.group.set",  std::bind(&cg_d_group_set, std::placeholders::_1, std::placeholders::_2));
+ 
+-  CMD2_DL         ("d.initialize_logs", tr1::bind(&cmd_d_initialize_logs, tr1::placeholders::_1));
++  CMD2_DL         ("d.initialize_logs", std::bind(&cmd_d_initialize_logs, std::placeholders::_1));
+ 
+-  CMD2_DL_LIST    ("f.multicall", tr1::bind(&f_multicall, tr1::placeholders::_1, tr1::placeholders::_2));
+-  CMD2_DL_LIST    ("p.multicall", tr1::bind(&p_multicall, tr1::placeholders::_1, tr1::placeholders::_2));
+-  CMD2_DL_LIST    ("t.multicall", tr1::bind(&t_multicall, tr1::placeholders::_1, tr1::placeholders::_2));
++  CMD2_DL_LIST    ("f.multicall", std::bind(&f_multicall, std::placeholders::_1, std::placeholders::_2));
++  CMD2_DL_LIST    ("p.multicall", std::bind(&p_multicall, std::placeholders::_1, std::placeholders::_2));
++  CMD2_DL_LIST    ("t.multicall", std::bind(&t_multicall, std::placeholders::_1, std::placeholders::_2));
+ 
+-  CMD2_ANY_LIST   ("p.call_target", tr1::bind(&p_call_target, tr1::placeholders::_2));
++  CMD2_ANY_LIST   ("p.call_target", std::bind(&p_call_target, std::placeholders::_2));
+ }
+--- src/command_dynamic.cc
++++ src/command_dynamic.cc
+@@ -127,18 +127,18 @@ system_method_insert_object(const torrent::Object::list_type& args, int flags) {
+ 
+   torrent::Object value;
+ 
+-  switch (flags & rpc::object_storage::mask_type) {
+-  case rpc::object_storage::flag_bool_type:
+-  case rpc::object_storage::flag_value_type:
++  switch (flags & rpc::mask_type) {
++  case rpc::flag_bool_type:
++  case rpc::flag_value_type:
+     value = itrArgs != args.end() ? rpc::convert_to_value(*itrArgs) : int64_t();
+     break;
+-  case rpc::object_storage::flag_string_type:
++  case rpc::flag_string_type:
+     value = itrArgs != args.end() ? rpc::convert_to_string(*itrArgs) : "";
+     break;
+-  case rpc::object_storage::flag_function_type:
++  case rpc::flag_function_type:
+     system_method_generate_command2(&value, itrArgs, args.end());
+     break;
+-  case rpc::object_storage::flag_multi_type:
++  case rpc::flag_multi_type:
+     break;
+   default:
+     throw torrent::input_error("Invalid type.");
+@@ -146,36 +146,36 @@ system_method_insert_object(const torrent::Object::list_type& args, int flags) {
+ 
+   int cmd_flags = 0;
+ 
+-  if (!(flags & rpc::object_storage::flag_static))
++  if (!(flags & rpc::flag_static))
+     cmd_flags |= rpc::CommandMap::flag_modifiable;
+-  if (!(flags & rpc::object_storage::flag_private))
++  if (!(flags & rpc::flag_private))
+     cmd_flags |= rpc::CommandMap::flag_public_xmlrpc;
+ 
+   control->object_storage()->insert_str(rawKey, value, flags);
+ 
+-  if ((flags & rpc::object_storage::mask_type) == rpc::object_storage::flag_function_type ||
+-      (flags & rpc::object_storage::mask_type) == rpc::object_storage::flag_multi_type) {
++  if ((flags & rpc::mask_type) == rpc::flag_function_type ||
++      (flags & rpc::mask_type) == rpc::flag_multi_type) {
+ 
+     rpc::commands.insert_slot<rpc::command_base_is_type<rpc::command_base_call<rpc::target_type> >::type>
+       (create_new_key(rawKey),
+-       tr1::bind(&rpc::object_storage::call_function_str, control->object_storage(),
+-                 rawKey, tr1::placeholders::_1, tr1::placeholders::_2),
++       std::bind(&rpc::object_storage::call_function_str, control->object_storage(),
++                 rawKey, std::placeholders::_1, std::placeholders::_2),
+        &rpc::command_base_call<rpc::target_type>,
+        cmd_flags, NULL, NULL);
+ 
+   } else {
+     rpc::commands.insert_slot<rpc::command_base_is_type<rpc::command_base_call<rpc::target_type> >::type>
+       (create_new_key(rawKey),
+-       tr1::bind(&rpc::object_storage::get_str, control->object_storage(), rawKey),
++       std::bind(&rpc::object_storage::get_str, control->object_storage(), rawKey),
+        &rpc::command_base_call<rpc::target_type>,
+        cmd_flags, NULL, NULL);
+   }
+ 
+   // Not the right argument.
+-  // if (flags & rpc::object_storage::flag_rlookup) {
++  // if (flags & rpc::flag_rlookup) {
+   //   rpc::commands.insert_slot<rpc::command_base_is_type<rpc::command_base_call_string<rpc::target_type> >::type>
+   //     (create_new_key<9>(rawKey, ".rlookup"),
+-  //      tr1::bind(&rpc::object_storage::rlookup_obj_list, control->object_storage(), rawKey),
++  //      std::bind(&rpc::object_storage::rlookup_obj_list, control->object_storage(), rawKey),
+   //      &rpc::command_base_call_string<rpc::target_type>,
+   //      cmd_flags, NULL, NULL);
+   // }
+@@ -184,31 +184,31 @@ system_method_insert_object(const torrent::Object::list_type& args, int flags) {
+ 
+ //   // Ehm... no proper handling if these throw.
+ 
+-  if (!(flags & rpc::object_storage::flag_constant)) {
+-    switch (flags & rpc::object_storage::mask_type) {
+-    case rpc::object_storage::flag_bool_type:
++  if (!(flags & rpc::flag_constant)) {
++    switch (flags & rpc::mask_type) {
++    case rpc::flag_bool_type:
+       rpc::commands.insert_slot<rpc::command_base_is_type<rpc::command_base_call_value<rpc::target_type> >::type>
+         (create_new_key<5>(rawKey, ".set"),
+-         tr1::bind(&rpc::object_storage::set_str_bool, control->object_storage(), rawKey, tr1::placeholders::_2),
++         std::bind(&rpc::object_storage::set_str_bool, control->object_storage(), rawKey, std::placeholders::_2),
+          &rpc::command_base_call_value<rpc::target_type>,
+          cmd_flags, NULL, NULL);
+       break;
+-    case rpc::object_storage::flag_value_type:
++    case rpc::flag_value_type:
+       rpc::commands.insert_slot<rpc::command_base_is_type<rpc::command_base_call_value<rpc::target_type> >::type>
+         (create_new_key<5>(rawKey, ".set"),
+-         tr1::bind(&rpc::object_storage::set_str_value, control->object_storage(), rawKey, tr1::placeholders::_2),
++         std::bind(&rpc::object_storage::set_str_value, control->object_storage(), rawKey, std::placeholders::_2),
+          &rpc::command_base_call_value<rpc::target_type>,
+          cmd_flags, NULL, NULL);
+       break;
+-    case rpc::object_storage::flag_string_type:
++    case rpc::flag_string_type:
+       rpc::commands.insert_slot<rpc::command_base_is_type<rpc::command_base_call_string<rpc::target_type> >::type>
+         (create_new_key<5>(rawKey, ".set"),
+-         tr1::bind(&rpc::object_storage::set_str_string, control->object_storage(), rawKey, tr1::placeholders::_2),
++         std::bind(&rpc::object_storage::set_str_string, control->object_storage(), rawKey, std::placeholders::_2),
+          &rpc::command_base_call_string<rpc::target_type>,
+          cmd_flags, NULL, NULL);
+       break;
+-    case rpc::object_storage::flag_function_type:
+-    case rpc::object_storage::flag_multi_type:
++    case rpc::flag_function_type:
++    case rpc::flag_multi_type:
+     default: break;
+     }
+   }
+@@ -256,16 +256,16 @@ system_method_insert(const torrent::Object::list_type& args) {
+     new_args.push_back(rawKey);
+     new_args.push_back(system_method_generate_command(++itrArgs, args.end()));
+ 
+-    int new_flags = rpc::object_storage::flag_multi_type;
++    int new_flags = rpc::flag_multi_type;
+ 
+     if (options.find("static") != std::string::npos)
+-      new_flags |= rpc::object_storage::flag_static;
++      new_flags |= rpc::flag_static;
+     if (options.find("private") != std::string::npos)
+-      new_flags |= rpc::object_storage::flag_private;
++      new_flags |= rpc::flag_private;
+     if (options.find("const") != std::string::npos)
+-      new_flags |= rpc::object_storage::flag_constant;
++      new_flags |= rpc::flag_constant;
+     if (options.find("rlookup") != std::string::npos)
+-      new_flags |= rpc::object_storage::flag_rlookup;
++      new_flags |= rpc::flag_rlookup;
+ 
+     return system_method_insert_object(new_args, new_flags);
+ 
+@@ -274,14 +274,14 @@ system_method_insert(const torrent::Object::list_type& args) {
+     new_args.push_back(rawKey);
+     new_args.push_back(system_method_generate_command(++itrArgs, args.end()));
+ 
+-    int new_flags = rpc::object_storage::flag_function_type;
++    int new_flags = rpc::flag_function_type;
+ 
+     if (options.find("static") != std::string::npos)
+-      new_flags |= rpc::object_storage::flag_static;
++      new_flags |= rpc::flag_static;
+     if (options.find("private") != std::string::npos)
+-      new_flags |= rpc::object_storage::flag_private;
++      new_flags |= rpc::flag_private;
+     if (options.find("const") != std::string::npos)
+-      new_flags |= rpc::object_storage::flag_constant;
++      new_flags |= rpc::flag_constant;
+ 
+     return system_method_insert_object(new_args, new_flags);
+ 
+@@ -299,24 +299,24 @@ system_method_insert(const torrent::Object::list_type& args) {
+     int new_flags;
+ 
+     if (options.find("value") != std::string::npos)
+-      new_flags = rpc::object_storage::flag_value_type;
++      new_flags = rpc::flag_value_type;
+     else if (options.find("bool") != std::string::npos)
+-      new_flags = rpc::object_storage::flag_bool_type;
++      new_flags = rpc::flag_bool_type;
+     else if (options.find("string") != std::string::npos)
+-      new_flags = rpc::object_storage::flag_string_type;
++      new_flags = rpc::flag_string_type;
+     else if (options.find("list") != std::string::npos)
+-      new_flags = rpc::object_storage::flag_list_type;
++      new_flags = rpc::flag_list_type;
+     else if (options.find("simple") != std::string::npos)
+-      new_flags = rpc::object_storage::flag_function_type;
++      new_flags = rpc::flag_function_type;
+     else 
+       throw torrent::input_error("No support for 'list' variable type.");
+ 
+     if (options.find("static") != std::string::npos)
+-      new_flags |= rpc::object_storage::flag_static;
++      new_flags |= rpc::flag_static;
+     if (options.find("private") != std::string::npos)
+-      new_flags |= rpc::object_storage::flag_private;
++      new_flags |= rpc::flag_private;
+     if (options.find("const") != std::string::npos)
+-      new_flags |= rpc::object_storage::flag_constant;
++      new_flags |= rpc::flag_constant;
+ 
+     return system_method_insert_object(new_args, new_flags);
+ 
+@@ -369,7 +369,7 @@ system_method_set_function(const torrent::Object::list_type& args) {
+   rpc::object_storage::local_iterator itr =
+     control->object_storage()->find_local(torrent::raw_string::from_string(args.front().as_string()));
+ 
+-  if (itr == control->object_storage()->end(0) || itr->second.flags & rpc::object_storage::flag_constant)
++  if (itr == control->object_storage()->end(0) || itr->second.flags & rpc::flag_constant)
+     throw torrent::input_error("Command is not modifiable.");    
+ 
+   return control->object_storage()->set_str_function(args.front().as_string(),
+@@ -434,38 +434,38 @@ cmd_catch(rpc::target_type target, const torrent::Object& args) {
+ }
+ 
+ #define CMD2_METHOD_INSERT(key, flags) \
+-  CMD2_ANY_LIST(key, tr1::bind(&system_method_insert_object, tr1::placeholders::_2, flags));
++  CMD2_ANY_LIST(key, std::bind(&system_method_insert_object, std::placeholders::_2, flags));
+ 
+ void
+ initialize_command_dynamic() {
+   CMD2_VAR_BOOL    ("method.use_deprecated", true);
+   CMD2_VAR_VALUE   ("method.use_intermediate", 1);
+ 
+-  CMD2_ANY_LIST    ("method.insert",             tr1::bind(&system_method_insert, tr1::placeholders::_2));
+-  CMD2_ANY_LIST    ("method.insert.value",       tr1::bind(&system_method_insert_object, tr1::placeholders::_2, rpc::object_storage::flag_value_type));
++  CMD2_ANY_LIST    ("method.insert",             std::bind(&system_method_insert, std::placeholders::_2));
++  CMD2_ANY_LIST    ("method.insert.value",       std::bind(&system_method_insert_object, std::placeholders::_2, rpc::flag_value_type));
+ 
+-  CMD2_METHOD_INSERT("method.insert.simple",     rpc::object_storage::flag_function_type);
+-  CMD2_METHOD_INSERT("method.insert.c_simple",   rpc::object_storage::flag_constant | rpc::object_storage::flag_function_type);
+-  CMD2_METHOD_INSERT("method.insert.s_c_simple", rpc::object_storage::flag_static |
+-                     rpc::object_storage::flag_constant |rpc::object_storage::flag_function_type);
++  CMD2_METHOD_INSERT("method.insert.simple",     rpc::flag_function_type);
++  CMD2_METHOD_INSERT("method.insert.c_simple",   rpc::flag_constant | rpc::flag_function_type);
++  CMD2_METHOD_INSERT("method.insert.s_c_simple", rpc::flag_static |
++                     rpc::flag_constant |rpc::flag_function_type);
+ 
+-  CMD2_ANY_STRING  ("method.erase",     tr1::bind(&system_method_erase, tr1::placeholders::_2));
+-  CMD2_ANY_LIST    ("method.redirect",  tr1::bind(&system_method_redirect, tr1::placeholders::_2));
+-  CMD2_ANY_STRING  ("method.get",       tr1::bind(&rpc::object_storage::get_str, control->object_storage(),
+-                                                       tr1::placeholders::_2));
+-  CMD2_ANY_LIST    ("method.set",       tr1::bind(&system_method_set_function, tr1::placeholders::_2));
++  CMD2_ANY_STRING  ("method.erase",     std::bind(&system_method_erase, std::placeholders::_2));
++  CMD2_ANY_LIST    ("method.redirect",  std::bind(&system_method_redirect, std::placeholders::_2));
++  CMD2_ANY_STRING  ("method.get",       std::bind(&rpc::object_storage::get_str, control->object_storage(),
++                                                       std::placeholders::_2));
++  CMD2_ANY_LIST    ("method.set",       std::bind(&system_method_set_function, std::placeholders::_2));
+ 
+-  CMD2_ANY_STRING  ("method.const",        tr1::bind(&rpc::object_storage::has_flag_str, control->object_storage(),
+-                                                      tr1::placeholders::_2, rpc::object_storage::flag_constant));
+-  CMD2_ANY_STRING_V("method.const.enable", tr1::bind(&rpc::object_storage::enable_flag_str, control->object_storage(),
+-                                                     tr1::placeholders::_2, rpc::object_storage::flag_constant));
++  CMD2_ANY_STRING  ("method.const",        std::bind(&rpc::object_storage::has_flag_str, control->object_storage(),
++                                                      std::placeholders::_2, rpc::flag_constant));
++  CMD2_ANY_STRING_V("method.const.enable", std::bind(&rpc::object_storage::enable_flag_str, control->object_storage(),
++                                                     std::placeholders::_2, rpc::flag_constant));
+ 
+-  CMD2_ANY_LIST    ("method.has_key",   tr1::bind(&system_method_has_key, tr1::placeholders::_2));
+-  CMD2_ANY_LIST    ("method.set_key",   tr1::bind(&system_method_set_key, tr1::placeholders::_2));
+-  CMD2_ANY_STRING  ("method.list_keys", tr1::bind(&system_method_list_keys, tr1::placeholders::_2));
++  CMD2_ANY_LIST    ("method.has_key",   std::bind(&system_method_has_key, std::placeholders::_2));
++  CMD2_ANY_LIST    ("method.set_key",   std::bind(&system_method_set_key, std::placeholders::_2));
++  CMD2_ANY_STRING  ("method.list_keys", std::bind(&system_method_list_keys, std::placeholders::_2));
+ 
+-  CMD2_ANY_STRING  ("method.rlookup",       tr1::bind(&rpc::object_storage::rlookup_obj_list, control->object_storage(), tr1::placeholders::_2));
+-  CMD2_ANY_STRING_V("method.rlookup.clear", tr1::bind(&rpc::object_storage::rlookup_clear, control->object_storage(), tr1::placeholders::_2));
++  CMD2_ANY_STRING  ("method.rlookup",       std::bind(&rpc::object_storage::rlookup_obj_list, control->object_storage(), std::placeholders::_2));
++  CMD2_ANY_STRING_V("method.rlookup.clear", std::bind(&rpc::object_storage::rlookup_clear, control->object_storage(), std::placeholders::_2));
+ 
+-  CMD2_ANY         ("catch", tr1::bind(&cmd_catch, tr1::placeholders::_1, tr1::placeholders::_2));
++  CMD2_ANY         ("catch", std::bind(&cmd_catch, std::placeholders::_1, std::placeholders::_2));
+ }
+--- src/command_events.cc
++++ src/command_events.cc
+@@ -308,31 +308,31 @@ d_multicall(const torrent::Object::list_type& args) {
+ 
+ void
+ initialize_command_events() {
+-  CMD2_ANY_STRING  ("on_ratio",        tr1::bind(&apply_on_ratio, tr1::placeholders::_2));
++  CMD2_ANY_STRING  ("on_ratio",        std::bind(&apply_on_ratio, std::placeholders::_2));
+ 
+-  CMD2_ANY         ("start_tied",      tr1::bind(&apply_start_tied));
+-  CMD2_ANY         ("stop_untied",     tr1::bind(&apply_stop_untied));
+-  CMD2_ANY         ("close_untied",    tr1::bind(&apply_close_untied));
+-  CMD2_ANY         ("remove_untied",   tr1::bind(&apply_remove_untied));
++  CMD2_ANY         ("start_tied",      std::bind(&apply_start_tied));
++  CMD2_ANY         ("stop_untied",     std::bind(&apply_stop_untied));
++  CMD2_ANY         ("close_untied",    std::bind(&apply_close_untied));
++  CMD2_ANY         ("remove_untied",   std::bind(&apply_remove_untied));
+ 
+-  CMD2_ANY_LIST    ("schedule2",        tr1::bind(&apply_schedule, tr1::placeholders::_2));
+-  CMD2_ANY_STRING_V("schedule_remove2", tr1::bind(&rpc::CommandScheduler::erase_str, control->command_scheduler(), tr1::placeholders::_2));
++  CMD2_ANY_LIST    ("schedule2",        std::bind(&apply_schedule, std::placeholders::_2));
++  CMD2_ANY_STRING_V("schedule_remove2", std::bind(&rpc::CommandScheduler::erase_str, control->command_scheduler(), std::placeholders::_2));
+ 
+-  CMD2_ANY_STRING_V("import",          tr1::bind(&apply_import, tr1::placeholders::_2));
+-  CMD2_ANY_STRING_V("try_import",      tr1::bind(&apply_try_import, tr1::placeholders::_2));
++  CMD2_ANY_STRING_V("import",          std::bind(&apply_import, std::placeholders::_2));
++  CMD2_ANY_STRING_V("try_import",      std::bind(&apply_try_import, std::placeholders::_2));
+ 
+-  CMD2_ANY_LIST    ("load.normal",        tr1::bind(&apply_load, tr1::placeholders::_2, core::Manager::create_quiet | core::Manager::create_tied));
+-  CMD2_ANY_LIST    ("load.verbose",       tr1::bind(&apply_load, tr1::placeholders::_2, core::Manager::create_tied));
+-  CMD2_ANY_LIST    ("load.start",         tr1::bind(&apply_load, tr1::placeholders::_2,
+-                                                         core::Manager::create_quiet | core::Manager::create_tied | core::Manager::create_start));
+-  CMD2_ANY_LIST    ("load.start_verbose", tr1::bind(&apply_load, tr1::placeholders::_2, core::Manager::create_tied  | core::Manager::create_start));
+-  CMD2_ANY_LIST    ("load.raw",           tr1::bind(&apply_load, tr1::placeholders::_2, core::Manager::create_quiet | core::Manager::create_raw_data));
+-  CMD2_ANY_LIST    ("load.raw_verbose",   tr1::bind(&apply_load, tr1::placeholders::_2, core::Manager::create_raw_data));
+-  CMD2_ANY_LIST    ("load.raw_start",     tr1::bind(&apply_load, tr1::placeholders::_2,
+-                                                         core::Manager::create_quiet | core::Manager::create_start | core::Manager::create_raw_data));
++  CMD2_ANY_LIST    ("load.normal",        std::bind(&apply_load, std::placeholders::_2, core::create_quiet | core::create_tied));
++  CMD2_ANY_LIST    ("load.verbose",       std::bind(&apply_load, std::placeholders::_2, core::create_tied));
++  CMD2_ANY_LIST    ("load.start",         std::bind(&apply_load, std::placeholders::_2,
++                                                         core::create_quiet | core::create_tied | core::create_start));
++  CMD2_ANY_LIST    ("load.start_verbose", std::bind(&apply_load, std::placeholders::_2, core::create_tied  | core::create_start));
++  CMD2_ANY_LIST    ("load.raw",           std::bind(&apply_load, std::placeholders::_2, core::create_quiet | core::create_raw_data));
++  CMD2_ANY_LIST    ("load.raw_verbose",   std::bind(&apply_load, std::placeholders::_2, core::create_raw_data));
++  CMD2_ANY_LIST    ("load.raw_start",     std::bind(&apply_load, std::placeholders::_2,
++                                                         core::create_quiet | core::create_start | core::create_raw_data));
+ 
+-  CMD2_ANY_VALUE   ("close_low_diskspace", tr1::bind(&apply_close_low_diskspace, tr1::placeholders::_2));
++  CMD2_ANY_VALUE   ("close_low_diskspace", std::bind(&apply_close_low_diskspace, std::placeholders::_2));
+ 
+-  CMD2_ANY_LIST    ("download_list",       tr1::bind(&apply_download_list, tr1::placeholders::_2));
+-  CMD2_ANY_LIST    ("d.multicall2",        tr1::bind(&d_multicall, tr1::placeholders::_2));
++  CMD2_ANY_LIST    ("download_list",       std::bind(&apply_download_list, std::placeholders::_2));
++  CMD2_ANY_LIST    ("d.multicall2",        std::bind(&d_multicall, std::placeholders::_2));
+ }
+--- src/command_file.cc
++++ src/command_file.cc
+@@ -100,45 +100,45 @@ apply_fi_filename_last(torrent::FileListIterator* itr) {
+ 
+ void
+ initialize_command_file() {
+-  CMD2_FILE("f.is_created",             tr1::bind(&torrent::File::is_created, tr1::placeholders::_1));
+-  CMD2_FILE("f.is_open",                tr1::bind(&torrent::File::is_open, tr1::placeholders::_1));
++  CMD2_FILE("f.is_created",             std::bind(&torrent::File::is_created, std::placeholders::_1));
++  CMD2_FILE("f.is_open",                std::bind(&torrent::File::is_open, std::placeholders::_1));
+ 
+-  CMD2_FILE("f.is_create_queued",       tr1::bind(&torrent::File::is_create_queued, tr1::placeholders::_1));
+-  CMD2_FILE("f.is_resize_queued",       tr1::bind(&torrent::File::is_resize_queued, tr1::placeholders::_1));
++  CMD2_FILE("f.is_create_queued",       std::bind(&torrent::File::is_create_queued, std::placeholders::_1));
++  CMD2_FILE("f.is_resize_queued",       std::bind(&torrent::File::is_resize_queued, std::placeholders::_1));
+ 
+-  CMD2_FILE_VALUE_V("f.set_create_queued",   tr1::bind(&torrent::File::set_flags,   tr1::placeholders::_1, torrent::File::flag_create_queued));
+-  CMD2_FILE_VALUE_V("f.set_resize_queued",   tr1::bind(&torrent::File::set_flags,   tr1::placeholders::_1, torrent::File::flag_resize_queued));
+-  CMD2_FILE_VALUE_V("f.unset_create_queued", tr1::bind(&torrent::File::unset_flags, tr1::placeholders::_1, torrent::File::flag_create_queued));
+-  CMD2_FILE_VALUE_V("f.unset_resize_queued", tr1::bind(&torrent::File::unset_flags, tr1::placeholders::_1, torrent::File::flag_resize_queued));
++  CMD2_FILE_VALUE_V("f.set_create_queued",   std::bind(&torrent::File::set_flags,   std::placeholders::_1, torrent::File::flag_create_queued));
++  CMD2_FILE_VALUE_V("f.set_resize_queued",   std::bind(&torrent::File::set_flags,   std::placeholders::_1, torrent::File::flag_resize_queued));
++  CMD2_FILE_VALUE_V("f.unset_create_queued", std::bind(&torrent::File::unset_flags, std::placeholders::_1, torrent::File::flag_create_queued));
++  CMD2_FILE_VALUE_V("f.unset_resize_queued", std::bind(&torrent::File::unset_flags, std::placeholders::_1, torrent::File::flag_resize_queued));
+ 
+-  CMD2_FILE  ("f.prioritize_first",         tr1::bind(&torrent::File::has_flags,   tr1::placeholders::_1, torrent::File::flag_prioritize_first));
+-  CMD2_FILE_V("f.prioritize_first.enable",  tr1::bind(&torrent::File::set_flags,   tr1::placeholders::_1, torrent::File::flag_prioritize_first));
+-  CMD2_FILE_V("f.prioritize_first.disable", tr1::bind(&torrent::File::unset_flags, tr1::placeholders::_1, torrent::File::flag_prioritize_first));
+-  CMD2_FILE  ("f.prioritize_last",          tr1::bind(&torrent::File::has_flags,   tr1::placeholders::_1, torrent::File::flag_prioritize_last));
+-  CMD2_FILE_V("f.prioritize_last.enable",   tr1::bind(&torrent::File::set_flags,   tr1::placeholders::_1, torrent::File::flag_prioritize_last));
+-  CMD2_FILE_V("f.prioritize_last.disable",  tr1::bind(&torrent::File::unset_flags, tr1::placeholders::_1, torrent::File::flag_prioritize_last));
++  CMD2_FILE  ("f.prioritize_first",         std::bind(&torrent::File::has_flags,   std::placeholders::_1, torrent::File::flag_prioritize_first));
++  CMD2_FILE_V("f.prioritize_first.enable",  std::bind(&torrent::File::set_flags,   std::placeholders::_1, torrent::File::flag_prioritize_first));
++  CMD2_FILE_V("f.prioritize_first.disable", std::bind(&torrent::File::unset_flags, std::placeholders::_1, torrent::File::flag_prioritize_first));
++  CMD2_FILE  ("f.prioritize_last",          std::bind(&torrent::File::has_flags,   std::placeholders::_1, torrent::File::flag_prioritize_last));
++  CMD2_FILE_V("f.prioritize_last.enable",   std::bind(&torrent::File::set_flags,   std::placeholders::_1, torrent::File::flag_prioritize_last));
++  CMD2_FILE_V("f.prioritize_last.disable",  std::bind(&torrent::File::unset_flags, std::placeholders::_1, torrent::File::flag_prioritize_last));
+ 
+-  CMD2_FILE("f.size_bytes",             tr1::bind(&torrent::File::size_bytes, tr1::placeholders::_1));
+-  CMD2_FILE("f.size_chunks",            tr1::bind(&torrent::File::size_chunks, tr1::placeholders::_1));
+-  CMD2_FILE("f.completed_chunks",       tr1::bind(&torrent::File::completed_chunks, tr1::placeholders::_1));
++  CMD2_FILE("f.size_bytes",             std::bind(&torrent::File::size_bytes, std::placeholders::_1));
++  CMD2_FILE("f.size_chunks",            std::bind(&torrent::File::size_chunks, std::placeholders::_1));
++  CMD2_FILE("f.completed_chunks",       std::bind(&torrent::File::completed_chunks, std::placeholders::_1));
+ 
+-  CMD2_FILE("f.offset",                 tr1::bind(&torrent::File::offset, tr1::placeholders::_1));
+-  CMD2_FILE("f.range_first",            tr1::bind(&torrent::File::range_first, tr1::placeholders::_1));
+-  CMD2_FILE("f.range_second",           tr1::bind(&torrent::File::range_second, tr1::placeholders::_1));
++  CMD2_FILE("f.offset",                 std::bind(&torrent::File::offset, std::placeholders::_1));
++  CMD2_FILE("f.range_first",            std::bind(&torrent::File::range_first, std::placeholders::_1));
++  CMD2_FILE("f.range_second",           std::bind(&torrent::File::range_second, std::placeholders::_1));
+ 
+-  CMD2_FILE("f.priority",               tr1::bind(&torrent::File::priority, tr1::placeholders::_1));
+-  CMD2_FILE_VALUE_V("f.priority.set",   tr1::bind(&apply_f_set_priority, tr1::placeholders::_1, tr1::placeholders::_2));
++  CMD2_FILE("f.priority",               std::bind(&torrent::File::priority, std::placeholders::_1));
++  CMD2_FILE_VALUE_V("f.priority.set",   std::bind(&apply_f_set_priority, std::placeholders::_1, std::placeholders::_2));
+ 
+-  CMD2_FILE("f.path",                   tr1::bind(&apply_f_path, tr1::placeholders::_1));
+-  CMD2_FILE("f.path_components",        tr1::bind(&apply_f_path_components, tr1::placeholders::_1));
+-  CMD2_FILE("f.path_depth",             tr1::bind(&apply_f_path_depth, tr1::placeholders::_1));
+-  CMD2_FILE("f.frozen_path",            tr1::bind(&torrent::File::frozen_path, tr1::placeholders::_1));
++  CMD2_FILE("f.path",                   std::bind(&apply_f_path, std::placeholders::_1));
++  CMD2_FILE("f.path_components",        std::bind(&apply_f_path_components, std::placeholders::_1));
++  CMD2_FILE("f.path_depth",             std::bind(&apply_f_path_depth, std::placeholders::_1));
++  CMD2_FILE("f.frozen_path",            std::bind(&torrent::File::frozen_path, std::placeholders::_1));
+ 
+-  CMD2_FILE("f.match_depth_prev",       tr1::bind(&torrent::File::match_depth_prev, tr1::placeholders::_1));
+-  CMD2_FILE("f.match_depth_next",       tr1::bind(&torrent::File::match_depth_next, tr1::placeholders::_1));
++  CMD2_FILE("f.match_depth_prev",       std::bind(&torrent::File::match_depth_prev, std::placeholders::_1));
++  CMD2_FILE("f.match_depth_next",       std::bind(&torrent::File::match_depth_next, std::placeholders::_1));
+ 
+-  CMD2_FILE("f.last_touched",           tr1::bind(&torrent::File::last_touched, tr1::placeholders::_1));
++  CMD2_FILE("f.last_touched",           std::bind(&torrent::File::last_touched, std::placeholders::_1));
+ 
+-  CMD2_FILEITR("fi.filename_last",      tr1::bind(&apply_fi_filename_last, tr1::placeholders::_1));
+-  CMD2_FILEITR("fi.is_file",            tr1::bind(&torrent::FileListIterator::is_file, tr1::placeholders::_1));
++  CMD2_FILEITR("fi.filename_last",      std::bind(&apply_fi_filename_last, std::placeholders::_1));
++  CMD2_FILEITR("fi.is_file",            std::bind(&torrent::FileListIterator::is_file, std::placeholders::_1));
+ }
+--- src/command_groups.cc
++++ src/command_groups.cc
+@@ -264,8 +264,8 @@ apply_cg_tracker_mode_set(const torrent::Object::list_type& args) {
+   return torrent::Object();
+ }
+ 
+-#define CG_GROUP_AT()          tr1::bind(&cg_get_group, tr1::placeholders::_2)
+-#define CHOKE_GROUP(direction) tr1::bind(direction, CG_GROUP_AT())
++#define CG_GROUP_AT()          std::bind(&cg_get_group, std::placeholders::_2)
++#define CHOKE_GROUP(direction) std::bind(direction, CG_GROUP_AT())
+ 
+ /*
+ 
+@@ -336,54 +336,54 @@ options.
+ void
+ initialize_command_groups() {
+   // Move somewhere else?
+-  CMD2_ANY         ("strings.choke_heuristics",          tr1::bind(&torrent::option_list_strings, torrent::OPTION_CHOKE_HEURISTICS));
+-  CMD2_ANY         ("strings.choke_heuristics.upload",   tr1::bind(&torrent::option_list_strings, torrent::OPTION_CHOKE_HEURISTICS_UPLOAD));
+-  CMD2_ANY         ("strings.choke_heuristics.download", tr1::bind(&torrent::option_list_strings, torrent::OPTION_CHOKE_HEURISTICS_DOWNLOAD));
+-  CMD2_ANY         ("strings.tracker_mode",              tr1::bind(&torrent::option_list_strings, torrent::OPTION_TRACKER_MODE));
++  CMD2_ANY         ("strings.choke_heuristics",          std::bind(&torrent::option_list_strings, torrent::OPTION_CHOKE_HEURISTICS));
++  CMD2_ANY         ("strings.choke_heuristics.upload",   std::bind(&torrent::option_list_strings, torrent::OPTION_CHOKE_HEURISTICS_UPLOAD));
++  CMD2_ANY         ("strings.choke_heuristics.download", std::bind(&torrent::option_list_strings, torrent::OPTION_CHOKE_HEURISTICS_DOWNLOAD));
++  CMD2_ANY         ("strings.tracker_mode",              std::bind(&torrent::option_list_strings, torrent::OPTION_TRACKER_MODE));
+ 
+-  CMD2_ANY         ("choke_group.list",                tr1::bind(&apply_cg_list));
+-  CMD2_ANY_STRING  ("choke_group.insert",              tr1::bind(&apply_cg_insert, tr1::placeholders::_2));
++  CMD2_ANY         ("choke_group.list",                std::bind(&apply_cg_list));
++  CMD2_ANY_STRING  ("choke_group.insert",              std::bind(&apply_cg_insert, std::placeholders::_2));
+ 
+ #if USE_CHOKE_GROUP
+-  CMD2_ANY         ("choke_group.size",                tr1::bind(&torrent::ResourceManager::group_size, torrent::resource_manager()));
+-  CMD2_ANY_STRING  ("choke_group.index_of",            tr1::bind(&torrent::ResourceManager::group_index_of, torrent::resource_manager(), tr1::placeholders::_2));
++  CMD2_ANY         ("choke_group.size",                std::bind(&torrent::ResourceManager::group_size, torrent::resource_manager()));
++  CMD2_ANY_STRING  ("choke_group.index_of",            std::bind(&torrent::ResourceManager::group_index_of, torrent::resource_manager(), std::placeholders::_2));
+ #else
+   apply_cg_insert("default");
+ 
+-  CMD2_ANY         ("choke_group.size",                tr1::bind(&std::vector<torrent::choke_group*>::size, cg_list_hack));
+-  CMD2_ANY_STRING  ("choke_group.index_of",            tr1::bind(&apply_cg_index_of, tr1::placeholders::_2));
++  CMD2_ANY         ("choke_group.size",                std::bind(&std::vector<torrent::choke_group*>::size, cg_list_hack));
++  CMD2_ANY_STRING  ("choke_group.index_of",            std::bind(&apply_cg_index_of, std::placeholders::_2));
+ #endif
+ 
+   // Commands specific for a group. Supports as the first argument the
+   // name, the index or a negative index.
+-  CMD2_ANY         ("choke_group.general.size",        tr1::bind(&torrent::choke_group::size, CG_GROUP_AT()));
+-
+-  CMD2_ANY         ("choke_group.tracker.mode",        tr1::bind(&torrent::option_as_string, torrent::OPTION_TRACKER_MODE,
+-                                                                 tr1::bind(&torrent::choke_group::tracker_mode, CG_GROUP_AT())));
+-  CMD2_ANY_LIST    ("choke_group.tracker.mode.set",    tr1::bind(&apply_cg_tracker_mode_set, tr1::placeholders::_2));
+-
+-  CMD2_ANY         ("choke_group.up.rate",             tr1::bind(&torrent::choke_group::up_rate, CG_GROUP_AT()));
+-  CMD2_ANY         ("choke_group.down.rate",           tr1::bind(&torrent::choke_group::down_rate, CG_GROUP_AT()));
+-
+-  CMD2_ANY         ("choke_group.up.max.unlimited",    tr1::bind(&torrent::choke_queue::is_unlimited, CHOKE_GROUP(&torrent::choke_group::up_queue)));
+-  CMD2_ANY         ("choke_group.up.max",              tr1::bind(&torrent::choke_queue::max_unchoked_signed, CHOKE_GROUP(&torrent::choke_group::up_queue)));
+-  CMD2_ANY_LIST    ("choke_group.up.max.set",          tr1::bind(&apply_cg_max_set, tr1::placeholders::_2, true));
+-
+-  CMD2_ANY         ("choke_group.up.total",            tr1::bind(&torrent::choke_queue::size_total, CHOKE_GROUP(&torrent::choke_group::up_queue)));
+-  CMD2_ANY         ("choke_group.up.queued",           tr1::bind(&torrent::choke_queue::size_queued, CHOKE_GROUP(&torrent::choke_group::up_queue)));
+-  CMD2_ANY         ("choke_group.up.unchoked",         tr1::bind(&torrent::choke_queue::size_unchoked, CHOKE_GROUP(&torrent::choke_group::up_queue)));
+-  CMD2_ANY         ("choke_group.up.heuristics",       tr1::bind(&torrent::option_as_string, torrent::OPTION_CHOKE_HEURISTICS,
+-                                                                 tr1::bind(&torrent::choke_queue::heuristics, CHOKE_GROUP(&torrent::choke_group::up_queue))));
+-  CMD2_ANY_LIST    ("choke_group.up.heuristics.set",   tr1::bind(&apply_cg_heuristics_set, tr1::placeholders::_2, true));
+-
+-  CMD2_ANY         ("choke_group.down.max.unlimited",  tr1::bind(&torrent::choke_queue::is_unlimited, CHOKE_GROUP(&torrent::choke_group::down_queue)));
+-  CMD2_ANY         ("choke_group.down.max",            tr1::bind(&torrent::choke_queue::max_unchoked_signed, CHOKE_GROUP(&torrent::choke_group::down_queue)));
+-  CMD2_ANY_LIST    ("choke_group.down.max.set",        tr1::bind(&apply_cg_max_set, tr1::placeholders::_2, false));
+-
+-  CMD2_ANY         ("choke_group.down.total",          tr1::bind(&torrent::choke_queue::size_total, CHOKE_GROUP(&torrent::choke_group::down_queue)));
+-  CMD2_ANY         ("choke_group.down.queued",         tr1::bind(&torrent::choke_queue::size_queued, CHOKE_GROUP(&torrent::choke_group::down_queue)));
+-  CMD2_ANY         ("choke_group.down.unchoked",       tr1::bind(&torrent::choke_queue::size_unchoked, CHOKE_GROUP(&torrent::choke_group::down_queue)));
+-  CMD2_ANY         ("choke_group.down.heuristics",     tr1::bind(&torrent::option_as_string, torrent::OPTION_CHOKE_HEURISTICS,
+-                                                                 tr1::bind(&torrent::choke_queue::heuristics, CHOKE_GROUP(&torrent::choke_group::down_queue))));
+-  CMD2_ANY_LIST    ("choke_group.down.heuristics.set", tr1::bind(&apply_cg_heuristics_set, tr1::placeholders::_2, false));
++  CMD2_ANY         ("choke_group.general.size",        std::bind(&torrent::choke_group::size, CG_GROUP_AT()));
++
++  CMD2_ANY         ("choke_group.tracker.mode",        std::bind(&torrent::option_as_string, torrent::OPTION_TRACKER_MODE,
++                                                                 std::bind(&torrent::choke_group::tracker_mode, CG_GROUP_AT())));
++  CMD2_ANY_LIST    ("choke_group.tracker.mode.set",    std::bind(&apply_cg_tracker_mode_set, std::placeholders::_2));
++
++  CMD2_ANY         ("choke_group.up.rate",             std::bind(&torrent::choke_group::up_rate, CG_GROUP_AT()));
++  CMD2_ANY         ("choke_group.down.rate",           std::bind(&torrent::choke_group::down_rate, CG_GROUP_AT()));
++
++  CMD2_ANY         ("choke_group.up.max.unlimited",    std::bind(&torrent::choke_queue::is_unlimited, CHOKE_GROUP(&torrent::choke_group::up_queue)));
++  CMD2_ANY         ("choke_group.up.max",              std::bind(&torrent::choke_queue::max_unchoked_signed, CHOKE_GROUP(&torrent::choke_group::up_queue)));
++  CMD2_ANY_LIST    ("choke_group.up.max.set",          std::bind(&apply_cg_max_set, std::placeholders::_2, true));
++
++  CMD2_ANY         ("choke_group.up.total",            std::bind(&torrent::choke_queue::size_total, CHOKE_GROUP(&torrent::choke_group::up_queue)));
++  CMD2_ANY         ("choke_group.up.queued",           std::bind(&torrent::choke_queue::size_queued, CHOKE_GROUP(&torrent::choke_group::up_queue)));
++  CMD2_ANY         ("choke_group.up.unchoked",         std::bind(&torrent::choke_queue::size_unchoked, CHOKE_GROUP(&torrent::choke_group::up_queue)));
++  CMD2_ANY         ("choke_group.up.heuristics",       std::bind(&torrent::option_as_string, torrent::OPTION_CHOKE_HEURISTICS,
++                                                                 std::bind(&torrent::choke_queue::heuristics, CHOKE_GROUP(&torrent::choke_group::up_queue))));
++  CMD2_ANY_LIST    ("choke_group.up.heuristics.set",   std::bind(&apply_cg_heuristics_set, std::placeholders::_2, true));
++
++  CMD2_ANY         ("choke_group.down.max.unlimited",  std::bind(&torrent::choke_queue::is_unlimited, CHOKE_GROUP(&torrent::choke_group::down_queue)));
++  CMD2_ANY         ("choke_group.down.max",            std::bind(&torrent::choke_queue::max_unchoked_signed, CHOKE_GROUP(&torrent::choke_group::down_queue)));
++  CMD2_ANY_LIST    ("choke_group.down.max.set",        std::bind(&apply_cg_max_set, std::placeholders::_2, false));
++
++  CMD2_ANY         ("choke_group.down.total",          std::bind(&torrent::choke_queue::size_total, CHOKE_GROUP(&torrent::choke_group::down_queue)));
++  CMD2_ANY         ("choke_group.down.queued",         std::bind(&torrent::choke_queue::size_queued, CHOKE_GROUP(&torrent::choke_group::down_queue)));
++  CMD2_ANY         ("choke_group.down.unchoked",       std::bind(&torrent::choke_queue::size_unchoked, CHOKE_GROUP(&torrent::choke_group::down_queue)));
++  CMD2_ANY         ("choke_group.down.heuristics",     std::bind(&torrent::option_as_string, torrent::OPTION_CHOKE_HEURISTICS,
++                                                                 std::bind(&torrent::choke_queue::heuristics, CHOKE_GROUP(&torrent::choke_group::down_queue))));
++  CMD2_ANY_LIST    ("choke_group.down.heuristics.set", std::bind(&apply_cg_heuristics_set, std::placeholders::_2, false));
+ }
+--- src/command_helpers.h
++++ src/command_helpers.h
+@@ -41,7 +41,6 @@
+ #include "rpc/parse_commands.h"
+ #include "rpc/object_storage.h"
+ 
+-namespace tr1 { using namespace std::tr1; }
+ 
+ void initialize_commands();
+ 
+@@ -99,44 +98,44 @@ void initialize_commands();
+ #define CMD2_TRACKER_VALUE_V(key, slot) CMD2_A_FUNCTION(key, command_base_call_value<torrent::Tracker*>, object_convert_void(slot), "i:i", "")
+ 
+ #define CMD2_VAR_BOOL(key, value)                                       \
+-  control->object_storage()->insert_c_str(key, int64_t(value), rpc::object_storage::flag_bool_type); \
+-  CMD2_ANY(key, tr1::bind(&rpc::object_storage::get, control->object_storage(), \
++  control->object_storage()->insert_c_str(key, int64_t(value), rpc::flag_bool_type); \
++  CMD2_ANY(key, std::bind(&rpc::object_storage::get, control->object_storage(), \
+                                torrent::raw_string::from_c_str(key)));  \
+-  CMD2_ANY_VALUE(key ".set", tr1::bind(&rpc::object_storage::set_bool, control->object_storage(), \
+-                                            torrent::raw_string::from_c_str(key), tr1::placeholders::_2));
++  CMD2_ANY_VALUE(key ".set", std::bind(&rpc::object_storage::set_bool, control->object_storage(), \
++                                            torrent::raw_string::from_c_str(key), std::placeholders::_2));
+ 
+ #define CMD2_VAR_VALUE(key, value)                                      \
+-  control->object_storage()->insert_c_str(key, int64_t(value), rpc::object_storage::flag_value_type); \
+-  CMD2_ANY(key, tr1::bind(&rpc::object_storage::get, control->object_storage(), \
++  control->object_storage()->insert_c_str(key, int64_t(value), rpc::flag_value_type); \
++  CMD2_ANY(key, std::bind(&rpc::object_storage::get, control->object_storage(), \
+                                torrent::raw_string::from_c_str(key)));  \
+-  CMD2_ANY_VALUE(key ".set", tr1::bind(&rpc::object_storage::set_value, control->object_storage(), \
+-                                            torrent::raw_string::from_c_str(key), tr1::placeholders::_2));
++  CMD2_ANY_VALUE(key ".set", std::bind(&rpc::object_storage::set_value, control->object_storage(), \
++                                            torrent::raw_string::from_c_str(key), std::placeholders::_2));
+ 
+ #define CMD2_VAR_STRING(key, value)                                     \
+-  control->object_storage()->insert_c_str(key, value, rpc::object_storage::flag_string_type); \
+-  CMD2_ANY(key, tr1::bind(&rpc::object_storage::get, control->object_storage(), \
++  control->object_storage()->insert_c_str(key, value, rpc::flag_string_type); \
++  CMD2_ANY(key, std::bind(&rpc::object_storage::get, control->object_storage(), \
+                                torrent::raw_string::from_c_str(key)));  \
+-  CMD2_ANY_STRING(key ".set", tr1::bind(&rpc::object_storage::set_string, control->object_storage(), \
+-                                             torrent::raw_string::from_c_str(key), tr1::placeholders::_2));
++  CMD2_ANY_STRING(key ".set", std::bind(&rpc::object_storage::set_string, control->object_storage(), \
++                                             torrent::raw_string::from_c_str(key), std::placeholders::_2));
+ 
+ 
+ #define CMD2_VAR_C_STRING(key, value)                                   \
+-  control->object_storage()->insert_c_str(key, value, rpc::object_storage::flag_string_type); \
+-  CMD2_ANY(key, tr1::bind(&rpc::object_storage::get, control->object_storage(), \
++  control->object_storage()->insert_c_str(key, value, rpc::flag_string_type); \
++  CMD2_ANY(key, std::bind(&rpc::object_storage::get, control->object_storage(), \
+                                torrent::raw_string::from_c_str(key)));
+ 
+ #define CMD2_VAR_LIST(key)                                              \
+-  control->object_storage()->insert_c_str(key, torrent::Object::create_list(), rpc::object_storage::flag_list_type); \
+-  CMD2_ANY(key, tr1::bind(&rpc::object_storage::get, control->object_storage(), \
++  control->object_storage()->insert_c_str(key, torrent::Object::create_list(), rpc::flag_list_type); \
++  CMD2_ANY(key, std::bind(&rpc::object_storage::get, control->object_storage(), \
+                                torrent::raw_string::from_c_str(key)));  \
+-  CMD2_ANY_LIST(key ".set", tr1::bind(&rpc::object_storage::set_list, control->object_storage(), \
+-                                           torrent::raw_string::from_c_str(key), tr1::placeholders::_2)); \
+-  CMD2_ANY_VOID(key ".push_back", tr1::bind(&rpc::object_storage::list_push_back, control->object_storage(), \
+-                                                 torrent::raw_string::from_c_str(key), tr1::placeholders::_2));
++  CMD2_ANY_LIST(key ".set", std::bind(&rpc::object_storage::set_list, control->object_storage(), \
++                                           torrent::raw_string::from_c_str(key), std::placeholders::_2)); \
++  CMD2_ANY_VOID(key ".push_back", std::bind(&rpc::object_storage::list_push_back, control->object_storage(), \
++                                                 torrent::raw_string::from_c_str(key), std::placeholders::_2));
+ 
+ #define CMD2_FUNC_SINGLE(key, cmds)                                     \
+-  CMD2_ANY(key, tr1::bind(&rpc::command_function_call_object, torrent::Object(torrent::raw_string::from_c_str(cmds)), \
+-                               tr1::placeholders::_1, tr1::placeholders::_2));
++  CMD2_ANY(key, std::bind(&rpc::command_function_call_object, torrent::Object(torrent::raw_string::from_c_str(cmds)), \
++                               std::placeholders::_1, std::placeholders::_2));
+ 
+ #define CMD2_REDIRECT(from_key, to_key) \
+   rpc::commands.create_redirect(from_key, to_key, rpc::CommandMap::flag_public_xmlrpc | rpc::CommandMap::flag_dont_delete);
+--- src/command_ip.cc
++++ src/command_ip.cc
+@@ -281,17 +281,17 @@ apply_ipv4_filter_dump() {
+ 
+ void
+ initialize_command_ip() {
+-  CMD2_ANY         ("strings.ip_filter",       tr1::bind(&torrent::option_list_strings, torrent::OPTION_IP_FILTER));
+-  CMD2_ANY         ("strings.ip_tos",          tr1::bind(&torrent::option_list_strings, torrent::OPTION_IP_TOS));
+-
+-  CMD2_ANY_STRING  ("ip_tables.insert_table",  tr1::bind(&apply_ip_tables_insert_table, tr1::placeholders::_2));
+-  CMD2_ANY_STRING  ("ip_tables.size_data",     tr1::bind(&apply_ip_tables_size_data, tr1::placeholders::_2));
+-  CMD2_ANY_LIST    ("ip_tables.get",           tr1::bind(&apply_ip_tables_get, tr1::placeholders::_2));
+-  CMD2_ANY_LIST    ("ip_tables.add_address",   tr1::bind(&apply_ip_tables_add_address, tr1::placeholders::_2));
+-
+-  CMD2_ANY         ("ipv4_filter.size_data",   tr1::bind(&apply_ipv4_filter_size_data));
+-  CMD2_ANY_STRING  ("ipv4_filter.get",         tr1::bind(&apply_ipv4_filter_get, tr1::placeholders::_2));
+-  CMD2_ANY_LIST    ("ipv4_filter.add_address", tr1::bind(&apply_ipv4_filter_add_address, tr1::placeholders::_2));
+-  CMD2_ANY_LIST    ("ipv4_filter.load",        tr1::bind(&apply_ipv4_filter_load, tr1::placeholders::_2));
+-  CMD2_ANY_LIST    ("ipv4_filter.dump",        tr1::bind(&apply_ipv4_filter_dump));
++  CMD2_ANY         ("strings.ip_filter",       std::bind(&torrent::option_list_strings, torrent::OPTION_IP_FILTER));
++  CMD2_ANY         ("strings.ip_tos",          std::bind(&torrent::option_list_strings, torrent::OPTION_IP_TOS));
++
++  CMD2_ANY_STRING  ("ip_tables.insert_table",  std::bind(&apply_ip_tables_insert_table, std::placeholders::_2));
++  CMD2_ANY_STRING  ("ip_tables.size_data",     std::bind(&apply_ip_tables_size_data, std::placeholders::_2));
++  CMD2_ANY_LIST    ("ip_tables.get",           std::bind(&apply_ip_tables_get, std::placeholders::_2));
++  CMD2_ANY_LIST    ("ip_tables.add_address",   std::bind(&apply_ip_tables_add_address, std::placeholders::_2));
++
++  CMD2_ANY         ("ipv4_filter.size_data",   std::bind(&apply_ipv4_filter_size_data));
++  CMD2_ANY_STRING  ("ipv4_filter.get",         std::bind(&apply_ipv4_filter_get, std::placeholders::_2));
++  CMD2_ANY_LIST    ("ipv4_filter.add_address", std::bind(&apply_ipv4_filter_add_address, std::placeholders::_2));
++  CMD2_ANY_LIST    ("ipv4_filter.load",        std::bind(&apply_ipv4_filter_load, std::placeholders::_2));
++  CMD2_ANY_LIST    ("ipv4_filter.dump",        std::bind(&apply_ipv4_filter_dump));
+ }
+--- src/command_local.cc
++++ src/command_local.cc
+@@ -326,8 +326,8 @@ initialize_command_local() {
+   core::DownloadList*    dList = control->core()->download_list();
+   core::DownloadStore*   dStore = control->core()->download_store();
+ 
+-  CMD2_ANY         ("system.hostname", tr1::bind(&system_hostname));
+-  CMD2_ANY         ("system.pid",      tr1::bind(&getpid));
++  CMD2_ANY         ("system.hostname", std::bind(&system_hostname));
++  CMD2_ANY         ("system.pid",      std::bind(&getpid));
+ 
+   CMD2_VAR_C_STRING("system.api_version",           (int64_t)API_VERSION);
+   CMD2_VAR_C_STRING("system.client_version",        PACKAGE_VERSION);
+@@ -337,54 +337,54 @@ initialize_command_local() {
+   CMD2_VAR_VALUE   ("system.file.split_size",       -1);
+   CMD2_VAR_STRING  ("system.file.split_suffix",     ".part");
+ 
+-  CMD2_ANY         ("system.file_status_cache.size",   tr1::bind(&utils::FileStatusCache::size,
++  CMD2_ANY         ("system.file_status_cache.size",   std::bind(&utils::FileStatusCache::size,
+                                                                       (utils::FileStatusCache::base_type*)control->core()->file_status_cache()));
+-  CMD2_ANY_V       ("system.file_status_cache.prune",  tr1::bind(&utils::FileStatusCache::prune, control->core()->file_status_cache()));
++  CMD2_ANY_V       ("system.file_status_cache.prune",  std::bind(&utils::FileStatusCache::prune, control->core()->file_status_cache()));
+ 
+   CMD2_VAR_BOOL    ("file.prioritize_toc",          0);
+   CMD2_VAR_LIST    ("file.prioritize_toc.first");
+   CMD2_VAR_LIST    ("file.prioritize_toc.last");
+ 
+-  CMD2_ANY         ("system.files.opened_counter",     tr1::bind(&FM_t::files_opened_counter, fileManager));
+-  CMD2_ANY         ("system.files.closed_counter",     tr1::bind(&FM_t::files_closed_counter, fileManager));
+-  CMD2_ANY         ("system.files.failed_counter",     tr1::bind(&FM_t::files_failed_counter, fileManager));
+-
+-  CMD2_ANY         ("system.time",                     tr1::bind(&rak::timer::seconds, &cachedTime));
+-  CMD2_ANY         ("system.time_seconds",             tr1::bind(&rak::timer::current_seconds));
+-  CMD2_ANY         ("system.time_usec",                tr1::bind(&rak::timer::current_usec));
+-
+-  CMD2_ANY_VALUE_V ("system.umask.set",                tr1::bind(&umask, tr1::placeholders::_2));
+-
+-  CMD2_ANY         ("system.cwd",                      tr1::bind(&system_get_cwd));
+-  CMD2_ANY_STRING  ("system.cwd.set",                  tr1::bind(&system_set_cwd, tr1::placeholders::_2));
+-
+-  CMD2_ANY         ("pieces.sync.always_safe",         tr1::bind(&CM_t::safe_sync, chunkManager));
+-  CMD2_ANY_VALUE_V ("pieces.sync.always_safe.set",     tr1::bind(&CM_t::set_safe_sync, chunkManager, tr1::placeholders::_2));
+-  CMD2_ANY         ("pieces.sync.safe_free_diskspace", tr1::bind(&CM_t::safe_free_diskspace, chunkManager));
+-  CMD2_ANY         ("pieces.sync.timeout",             tr1::bind(&CM_t::timeout_sync, chunkManager));
+-  CMD2_ANY_VALUE_V ("pieces.sync.timeout.set",         tr1::bind(&CM_t::set_timeout_sync, chunkManager, tr1::placeholders::_2));
+-  CMD2_ANY         ("pieces.sync.timeout_safe",        tr1::bind(&CM_t::timeout_safe_sync, chunkManager));
+-  CMD2_ANY_VALUE_V ("pieces.sync.timeout_safe.set",    tr1::bind(&CM_t::set_timeout_safe_sync, chunkManager, tr1::placeholders::_2));
+-  CMD2_ANY         ("pieces.sync.queue_size",          tr1::bind(&CM_t::sync_queue_size, chunkManager));
+-
+-  CMD2_ANY         ("pieces.preload.type",             tr1::bind(&CM_t::preload_type, chunkManager));
+-  CMD2_ANY_VALUE_V ("pieces.preload.type.set",         tr1::bind(&CM_t::set_preload_type, chunkManager, tr1::placeholders::_2));
+-  CMD2_ANY         ("pieces.preload.min_size",         tr1::bind(&CM_t::preload_min_size, chunkManager));
+-  CMD2_ANY_VALUE_V ("pieces.preload.min_size.set",     tr1::bind(&CM_t::set_preload_min_size, chunkManager, tr1::placeholders::_2));
+-  CMD2_ANY         ("pieces.preload.min_rate",         tr1::bind(&CM_t::preload_required_rate, chunkManager));
+-  CMD2_ANY_VALUE_V ("pieces.preload.min_rate.set",     tr1::bind(&CM_t::set_preload_required_rate, chunkManager, tr1::placeholders::_2));
+-
+-  CMD2_ANY         ("pieces.memory.current",           tr1::bind(&CM_t::memory_usage, chunkManager));
+-  CMD2_ANY         ("pieces.memory.sync_queue",        tr1::bind(&CM_t::sync_queue_memory_usage, chunkManager));
+-  CMD2_ANY         ("pieces.memory.block_count",       tr1::bind(&CM_t::memory_block_count, chunkManager));
+-  CMD2_ANY         ("pieces.memory.max",               tr1::bind(&CM_t::max_memory_usage, chunkManager));
+-  CMD2_ANY_VALUE_V ("pieces.memory.max.set",           tr1::bind(&CM_t::set_max_memory_usage, chunkManager, tr1::placeholders::_2));
+-  CMD2_ANY         ("pieces.stats_preloaded",          tr1::bind(&CM_t::stats_preloaded, chunkManager));
+-  CMD2_ANY         ("pieces.stats_not_preloaded",      tr1::bind(&CM_t::stats_not_preloaded, chunkManager));
+-
+-  CMD2_ANY         ("pieces.stats.total_size",         tr1::bind(&apply_pieces_stats_total_size));
+-
+-  CMD2_ANY         ("pieces.hash.queue_size",          tr1::bind(&torrent::hash_queue_size));
++  CMD2_ANY         ("system.files.opened_counter",     std::bind(&FM_t::files_opened_counter, fileManager));
++  CMD2_ANY         ("system.files.closed_counter",     std::bind(&FM_t::files_closed_counter, fileManager));
++  CMD2_ANY         ("system.files.failed_counter",     std::bind(&FM_t::files_failed_counter, fileManager));
++
++  CMD2_ANY         ("system.time",                     std::bind(&rak::timer::seconds, &cachedTime));
++  CMD2_ANY         ("system.time_seconds",             std::bind(&rak::timer::current_seconds));
++  CMD2_ANY         ("system.time_usec",                std::bind(&rak::timer::current_usec));
++
++  CMD2_ANY_VALUE_V ("system.umask.set",                std::bind(&umask, std::placeholders::_2));
++
++  CMD2_ANY         ("system.cwd",                      std::bind(&system_get_cwd));
++  CMD2_ANY_STRING  ("system.cwd.set",                  std::bind(&system_set_cwd, std::placeholders::_2));
++
++  CMD2_ANY         ("pieces.sync.always_safe",         std::bind(&CM_t::safe_sync, chunkManager));
++  CMD2_ANY_VALUE_V ("pieces.sync.always_safe.set",     std::bind(&CM_t::set_safe_sync, chunkManager, std::placeholders::_2));
++  CMD2_ANY         ("pieces.sync.safe_free_diskspace", std::bind(&CM_t::safe_free_diskspace, chunkManager));
++  CMD2_ANY         ("pieces.sync.timeout",             std::bind(&CM_t::timeout_sync, chunkManager));
++  CMD2_ANY_VALUE_V ("pieces.sync.timeout.set",         std::bind(&CM_t::set_timeout_sync, chunkManager, std::placeholders::_2));
++  CMD2_ANY         ("pieces.sync.timeout_safe",        std::bind(&CM_t::timeout_safe_sync, chunkManager));
++  CMD2_ANY_VALUE_V ("pieces.sync.timeout_safe.set",    std::bind(&CM_t::set_timeout_safe_sync, chunkManager, std::placeholders::_2));
++  CMD2_ANY         ("pieces.sync.queue_size",          std::bind(&CM_t::sync_queue_size, chunkManager));
++
++  CMD2_ANY         ("pieces.preload.type",             std::bind(&CM_t::preload_type, chunkManager));
++  CMD2_ANY_VALUE_V ("pieces.preload.type.set",         std::bind(&CM_t::set_preload_type, chunkManager, std::placeholders::_2));
++  CMD2_ANY         ("pieces.preload.min_size",         std::bind(&CM_t::preload_min_size, chunkManager));
++  CMD2_ANY_VALUE_V ("pieces.preload.min_size.set",     std::bind(&CM_t::set_preload_min_size, chunkManager, std::placeholders::_2));
++  CMD2_ANY         ("pieces.preload.min_rate",         std::bind(&CM_t::preload_required_rate, chunkManager));
++  CMD2_ANY_VALUE_V ("pieces.preload.min_rate.set",     std::bind(&CM_t::set_preload_required_rate, chunkManager, std::placeholders::_2));
++
++  CMD2_ANY         ("pieces.memory.current",           std::bind(&CM_t::memory_usage, chunkManager));
++  CMD2_ANY         ("pieces.memory.sync_queue",        std::bind(&CM_t::sync_queue_memory_usage, chunkManager));
++  CMD2_ANY         ("pieces.memory.block_count",       std::bind(&CM_t::memory_block_count, chunkManager));
++  CMD2_ANY         ("pieces.memory.max",               std::bind(&CM_t::max_memory_usage, chunkManager));
++  CMD2_ANY_VALUE_V ("pieces.memory.max.set",           std::bind(&CM_t::set_max_memory_usage, chunkManager, std::placeholders::_2));
++  CMD2_ANY         ("pieces.stats_preloaded",          std::bind(&CM_t::stats_preloaded, chunkManager));
++  CMD2_ANY         ("pieces.stats_not_preloaded",      std::bind(&CM_t::stats_not_preloaded, chunkManager));
++
++  CMD2_ANY         ("pieces.stats.total_size",         std::bind(&apply_pieces_stats_total_size));
++
++  CMD2_ANY         ("pieces.hash.queue_size",          std::bind(&torrent::hash_queue_size));
+   CMD2_VAR_BOOL    ("pieces.hash.on_completion",       true);
+ 
+   CMD2_VAR_STRING  ("directory.default",       "./");
+@@ -393,45 +393,45 @@ initialize_command_local() {
+   CMD2_VAR_BOOL    ("session.use_lock",        true);
+   CMD2_VAR_BOOL    ("session.on_completion",   true);
+ 
+-  CMD2_ANY         ("session.path",            tr1::bind(&core::DownloadStore::path, dStore));
+-  CMD2_ANY_STRING_V("session.path.set",        tr1::bind(&core::DownloadStore::set_path, dStore, tr1::placeholders::_2));
++  CMD2_ANY         ("session.path",            std::bind(&core::DownloadStore::path, dStore));
++  CMD2_ANY_STRING_V("session.path.set",        std::bind(&core::DownloadStore::set_path, dStore, std::placeholders::_2));
+ 
+-  CMD2_ANY_V       ("session.save",            tr1::bind(&core::DownloadList::session_save, dList));
++  CMD2_ANY_V       ("session.save",            std::bind(&core::DownloadList::session_save, dList));
+ 
+ #define CMD2_EXECUTE(key, flags)                                         \
+-  CMD2_ANY(key, tr1::bind(&rpc::ExecFile::execute_object, &rpc::execFile, tr1::placeholders::_2, flags));
+-
+-  CMD2_EXECUTE     ("execute2",                rpc::ExecFile::flag_expand_tilde | rpc::ExecFile::flag_throw);
+-  CMD2_EXECUTE     ("execute.throw",           rpc::ExecFile::flag_expand_tilde | rpc::ExecFile::flag_throw);
+-  CMD2_EXECUTE     ("execute.throw.bg",        rpc::ExecFile::flag_expand_tilde | rpc::ExecFile::flag_throw | rpc::ExecFile::flag_background);
+-  CMD2_EXECUTE     ("execute.nothrow",         rpc::ExecFile::flag_expand_tilde);
+-  CMD2_EXECUTE     ("execute.nothrow.bg",      rpc::ExecFile::flag_expand_tilde | rpc::ExecFile::flag_background);
+-  CMD2_EXECUTE     ("execute.raw",             rpc::ExecFile::flag_throw);
+-  CMD2_EXECUTE     ("execute.raw.bg",          rpc::ExecFile::flag_throw | rpc::ExecFile::flag_background);
++  CMD2_ANY(key, std::bind(&rpc::ExecFile::execute_object, &rpc::execFile, std::placeholders::_2, flags));
++
++  CMD2_EXECUTE     ("execute2",                rpc::flag_expand_tilde | rpc::flag_throw);
++  CMD2_EXECUTE     ("execute.throw",           rpc::flag_expand_tilde | rpc::flag_throw);
++  CMD2_EXECUTE     ("execute.throw.bg",        rpc::flag_expand_tilde | rpc::flag_throw | rpc::flag_background);
++  CMD2_EXECUTE     ("execute.nothrow",         rpc::flag_expand_tilde);
++  CMD2_EXECUTE     ("execute.nothrow.bg",      rpc::flag_expand_tilde | rpc::flag_background);
++  CMD2_EXECUTE     ("execute.raw",             rpc::flag_throw);
++  CMD2_EXECUTE     ("execute.raw.bg",          rpc::flag_throw | rpc::flag_background);
+   CMD2_EXECUTE     ("execute.raw_nothrow",     0);
+-  CMD2_EXECUTE     ("execute.raw_nothrow.bg",  rpc::ExecFile::flag_background);
+-  CMD2_EXECUTE     ("execute.capture",         rpc::ExecFile::flag_throw | rpc::ExecFile::flag_expand_tilde | rpc::ExecFile::flag_capture);
+-  CMD2_EXECUTE     ("execute.capture_nothrow", rpc::ExecFile::flag_expand_tilde | rpc::ExecFile::flag_capture);
++  CMD2_EXECUTE     ("execute.raw_nothrow.bg",  rpc::flag_background);
++  CMD2_EXECUTE     ("execute.capture",         rpc::flag_throw | rpc::flag_expand_tilde | rpc::flag_capture);
++  CMD2_EXECUTE     ("execute.capture_nothrow", rpc::flag_expand_tilde | rpc::flag_capture);
+ 
+-  CMD2_ANY_LIST    ("log.open_file",  tr1::bind(&apply_log_open_file, tr1::placeholders::_2));
+-  CMD2_ANY_LIST    ("log.add_output", tr1::bind(&apply_log_add_output, tr1::placeholders::_2));
++  CMD2_ANY_LIST    ("log.open_file",  std::bind(&apply_log_open_file, std::placeholders::_2));
++  CMD2_ANY_LIST    ("log.add_output", std::bind(&apply_log_add_output, std::placeholders::_2));
+ 
+-  CMD2_ANY_STRING  ("log.execute",    tr1::bind(&apply_log, tr1::placeholders::_2, 0));
+-  CMD2_ANY_STRING  ("log.vmmap.dump", tr1::bind(&log_vmmap_dump, tr1::placeholders::_2));
+-  CMD2_ANY_STRING_V("log.xmlrpc",     tr1::bind(&ThreadWorker::set_xmlrpc_log, worker_thread, tr1::placeholders::_2));
+-  CMD2_ANY_LIST    ("log.libtorrent", tr1::bind(&apply_log_libtorrent, tr1::placeholders::_2));
++  CMD2_ANY_STRING  ("log.execute",    std::bind(&apply_log, std::placeholders::_2, 0));
++  CMD2_ANY_STRING  ("log.vmmap.dump", std::bind(&log_vmmap_dump, std::placeholders::_2));
++  CMD2_ANY_STRING_V("log.xmlrpc",     std::bind(&ThreadWorker::set_xmlrpc_log, worker_thread, std::placeholders::_2));
++  CMD2_ANY_LIST    ("log.libtorrent", std::bind(&apply_log_libtorrent, std::placeholders::_2));
+ 
+-  CMD2_ANY_LIST    ("file.append",    tr1::bind(&cmd_file_append, tr1::placeholders::_2));
++  CMD2_ANY_LIST    ("file.append",    std::bind(&cmd_file_append, std::placeholders::_2));
+ 
+   // TODO: Convert to new command types:
+   *rpc::command_base::argument(0) = "placeholder.0";
+   *rpc::command_base::argument(1) = "placeholder.1";
+   *rpc::command_base::argument(2) = "placeholder.2";
+   *rpc::command_base::argument(3) = "placeholder.3";
+-  CMD2_ANY_P("argument.0", tr1::bind(&rpc::command_base::argument_ref, 0));
+-  CMD2_ANY_P("argument.1", tr1::bind(&rpc::command_base::argument_ref, 1));
+-  CMD2_ANY_P("argument.2", tr1::bind(&rpc::command_base::argument_ref, 2));
+-  CMD2_ANY_P("argument.3", tr1::bind(&rpc::command_base::argument_ref, 3));
++  CMD2_ANY_P("argument.0", std::bind(&rpc::command_base::argument_ref, 0));
++  CMD2_ANY_P("argument.1", std::bind(&rpc::command_base::argument_ref, 1));
++  CMD2_ANY_P("argument.2", std::bind(&rpc::command_base::argument_ref, 2));
++  CMD2_ANY_P("argument.3", std::bind(&rpc::command_base::argument_ref, 3));
+ 
+-  CMD2_ANY_LIST  ("group.insert", tr1::bind(&group_insert, tr1::placeholders::_2));
++  CMD2_ANY_LIST  ("group.insert", std::bind(&group_insert, std::placeholders::_2));
+ }
+--- src/command_network.cc
++++ src/command_network.cc
+@@ -62,7 +62,6 @@
+ #include "control.h"
+ #include "command_helpers.h"
+ 
+-namespace tr1 { using namespace std::tr1; }
+ 
+ torrent::Object
+ apply_encryption(const torrent::Object::list_type& args) {
+@@ -126,10 +125,10 @@ xmlrpc_find_peer(core::Download* download, const torrent::HashString& hash) {
+ void
+ initialize_xmlrpc() {
+   rpc::xmlrpc.initialize();
+-  rpc::xmlrpc.slot_find_download() = tr1::bind(&core::DownloadList::find_hex_ptr, control->core()->download_list(), tr1::placeholders::_1);
+-  rpc::xmlrpc.slot_find_file() = tr1::bind(&xmlrpc_find_file, tr1::placeholders::_1, tr1::placeholders::_2);
+-  rpc::xmlrpc.slot_find_tracker() = tr1::bind(&xmlrpc_find_tracker, tr1::placeholders::_1, tr1::placeholders::_2);
+-  rpc::xmlrpc.slot_find_peer() = tr1::bind(&xmlrpc_find_peer, tr1::placeholders::_1, tr1::placeholders::_2);
++  rpc::xmlrpc.slot_find_download() = std::bind(&core::DownloadList::find_hex_ptr, control->core()->download_list(), std::placeholders::_1);
++  rpc::xmlrpc.slot_find_file() = std::bind(&xmlrpc_find_file, std::placeholders::_1, std::placeholders::_2);
++  rpc::xmlrpc.slot_find_tracker() = std::bind(&xmlrpc_find_tracker, std::placeholders::_1, std::placeholders::_2);
++  rpc::xmlrpc.slot_find_peer() = std::bind(&xmlrpc_find_peer, std::placeholders::_1, std::placeholders::_2);
+ 
+   unsigned int count = 0;
+ 
+@@ -236,21 +235,21 @@ initialize_command_network() {
+   torrent::FileManager* fileManager = torrent::file_manager();
+   core::CurlStack* httpStack = control->core()->http_stack();
+ 
+-  CMD2_ANY         ("strings.connection_type", tr1::bind(&torrent::option_list_strings, torrent::OPTION_CONNECTION_TYPE));
+-  CMD2_ANY         ("strings.encryption",      tr1::bind(&torrent::option_list_strings, torrent::OPTION_ENCRYPTION));
++  CMD2_ANY         ("strings.connection_type", std::bind(&torrent::option_list_strings, torrent::OPTION_CONNECTION_TYPE));
++  CMD2_ANY         ("strings.encryption",      std::bind(&torrent::option_list_strings, torrent::OPTION_ENCRYPTION));
+ 
+-  // CMD2_ANY_STRING  ("encoding_list",    tr1::bind(&apply_encoding_list, tr1::placeholders::_2));
+-  CMD2_ANY_STRING  ("encoding.add", tr1::bind(&apply_encoding_list, tr1::placeholders::_2));
++  // CMD2_ANY_STRING  ("encoding_list",    std::bind(&apply_encoding_list, std::placeholders::_2));
++  CMD2_ANY_STRING  ("encoding.add", std::bind(&apply_encoding_list, std::placeholders::_2));
+ 
+   // Isn't port_open used?
+   CMD2_VAR_BOOL    ("network.port_open",   true);
+   CMD2_VAR_BOOL    ("network.port_random", true);
+   CMD2_VAR_STRING  ("network.port_range",  "6881-6999");
+ 
+-  CMD2_ANY         ("network.listen.port",    tr1::bind(&torrent::ConnectionManager::listen_port, cm));
++  CMD2_ANY         ("network.listen.port",    std::bind(&torrent::ConnectionManager::listen_port, cm));
+ 
+   CMD2_VAR_BOOL    ("protocol.pex",            true);
+-  CMD2_ANY_LIST    ("protocol.encryption.set", tr1::bind(&apply_encryption, tr1::placeholders::_2));
++  CMD2_ANY_LIST    ("protocol.encryption.set", std::bind(&apply_encryption, std::placeholders::_2));
+ 
+   CMD2_VAR_STRING  ("protocol.connection.leech", "leech");
+   CMD2_VAR_STRING  ("protocol.connection.seed",  "seed");
+@@ -260,43 +259,43 @@ initialize_command_network() {
+   CMD2_VAR_STRING  ("protocol.choke_heuristics.down.leech", "download_leech");
+   CMD2_VAR_STRING  ("protocol.choke_heuristics.down.seed",  "download_leech");
+ 
+-  CMD2_ANY         ("network.http.capath",                tr1::bind(&core::CurlStack::http_capath, httpStack));
+-  CMD2_ANY_STRING_V("network.http.capath.set",            tr1::bind(&core::CurlStack::set_http_capath, httpStack, tr1::placeholders::_2));
+-  CMD2_ANY         ("network.http.cacert",                tr1::bind(&core::CurlStack::http_cacert, httpStack));
+-  CMD2_ANY_STRING_V("network.http.cacert.set",            tr1::bind(&core::CurlStack::set_http_cacert, httpStack, tr1::placeholders::_2));
+-  CMD2_ANY         ("network.http.proxy_address",         tr1::bind(&core::CurlStack::http_proxy, httpStack));
+-  CMD2_ANY_STRING_V("network.http.proxy_address.set",     tr1::bind(&core::CurlStack::set_http_proxy, httpStack, tr1::placeholders::_2));
+-  CMD2_ANY         ("network.http.max_open",              tr1::bind(&core::CurlStack::max_active, httpStack));
+-  CMD2_ANY_VALUE_V ("network.http.max_open.set",          tr1::bind(&core::CurlStack::set_max_active, httpStack, tr1::placeholders::_2));
+-  CMD2_ANY         ("network.http.ssl_verify_peer",       tr1::bind(&core::CurlStack::ssl_verify_peer, httpStack));
+-  CMD2_ANY_VALUE_V ("network.http.ssl_verify_peer.set",   tr1::bind(&core::CurlStack::set_ssl_verify_peer, httpStack, tr1::placeholders::_2));
+-  CMD2_ANY         ("network.http.dns_cache_timeout",     tr1::bind(&core::CurlStack::dns_timeout, httpStack));
+-  CMD2_ANY_VALUE_V ("network.http.dns_cache_timeout.set", tr1::bind(&core::CurlStack::set_dns_timeout, httpStack, tr1::placeholders::_2));
+-
+-  CMD2_ANY         ("network.send_buffer.size",        tr1::bind(&torrent::ConnectionManager::send_buffer_size, cm));
+-  CMD2_ANY_VALUE_V ("network.send_buffer.size.set",    tr1::bind(&torrent::ConnectionManager::set_send_buffer_size, cm, tr1::placeholders::_2));
+-  CMD2_ANY         ("network.receive_buffer.size",     tr1::bind(&torrent::ConnectionManager::receive_buffer_size, cm));
+-  CMD2_ANY_VALUE_V ("network.receive_buffer.size.set", tr1::bind(&torrent::ConnectionManager::set_receive_buffer_size, cm, tr1::placeholders::_2));
+-  CMD2_ANY_STRING  ("network.tos.set",                 tr1::bind(&apply_tos, tr1::placeholders::_2));
+-
+-  CMD2_ANY         ("network.bind_address",        tr1::bind(&core::Manager::bind_address, control->core()));
+-  CMD2_ANY_STRING_V("network.bind_address.set",    tr1::bind(&core::Manager::set_bind_address, control->core(), tr1::placeholders::_2));
+-  CMD2_ANY         ("network.local_address",       tr1::bind(&core::Manager::local_address, control->core()));
+-  CMD2_ANY_STRING_V("network.local_address.set",   tr1::bind(&core::Manager::set_local_address, control->core(), tr1::placeholders::_2));
+-  CMD2_ANY         ("network.proxy_address",       tr1::bind(&core::Manager::proxy_address, control->core()));
+-  CMD2_ANY_STRING_V("network.proxy_address.set",   tr1::bind(&core::Manager::set_proxy_address, control->core(), tr1::placeholders::_2));
+-
+-  CMD2_ANY         ("network.max_open_files",       tr1::bind(&torrent::FileManager::max_open_files, fileManager));
+-  CMD2_ANY_VALUE_V ("network.max_open_files.set",   tr1::bind(&torrent::FileManager::set_max_open_files, fileManager, tr1::placeholders::_2));
+-  CMD2_ANY         ("network.open_sockets",         tr1::bind(&torrent::ConnectionManager::size, cm));
+-  CMD2_ANY         ("network.max_open_sockets",     tr1::bind(&torrent::ConnectionManager::max_size, cm));
+-  CMD2_ANY_VALUE_V ("network.max_open_sockets.set", tr1::bind(&torrent::ConnectionManager::set_max_size, cm, tr1::placeholders::_2));
+-
+-  CMD2_ANY_STRING  ("network.scgi.open_port",   tr1::bind(&apply_scgi, tr1::placeholders::_2, 1));
+-  CMD2_ANY_STRING  ("network.scgi.open_local",  tr1::bind(&apply_scgi, tr1::placeholders::_2, 2));
++  CMD2_ANY         ("network.http.capath",                std::bind(&core::CurlStack::http_capath, httpStack));
++  CMD2_ANY_STRING_V("network.http.capath.set",            std::bind(&core::CurlStack::set_http_capath, httpStack, std::placeholders::_2));
++  CMD2_ANY         ("network.http.cacert",                std::bind(&core::CurlStack::http_cacert, httpStack));
++  CMD2_ANY_STRING_V("network.http.cacert.set",            std::bind(&core::CurlStack::set_http_cacert, httpStack, std::placeholders::_2));
++  CMD2_ANY         ("network.http.proxy_address",         std::bind(&core::CurlStack::http_proxy, httpStack));
++  CMD2_ANY_STRING_V("network.http.proxy_address.set",     std::bind(&core::CurlStack::set_http_proxy, httpStack, std::placeholders::_2));
++  CMD2_ANY         ("network.http.max_open",              std::bind(&core::CurlStack::max_active, httpStack));
++  CMD2_ANY_VALUE_V ("network.http.max_open.set",          std::bind(&core::CurlStack::set_max_active, httpStack, std::placeholders::_2));
++  CMD2_ANY         ("network.http.ssl_verify_peer",       std::bind(&core::CurlStack::ssl_verify_peer, httpStack));
++  CMD2_ANY_VALUE_V ("network.http.ssl_verify_peer.set",   std::bind(&core::CurlStack::set_ssl_verify_peer, httpStack, std::placeholders::_2));
++  CMD2_ANY         ("network.http.dns_cache_timeout",     std::bind(&core::CurlStack::dns_timeout, httpStack));
++  CMD2_ANY_VALUE_V ("network.http.dns_cache_timeout.set", std::bind(&core::CurlStack::set_dns_timeout, httpStack, std::placeholders::_2));
++
++  CMD2_ANY         ("network.send_buffer.size",        std::bind(&torrent::ConnectionManager::send_buffer_size, cm));
++  CMD2_ANY_VALUE_V ("network.send_buffer.size.set",    std::bind(&torrent::ConnectionManager::set_send_buffer_size, cm, std::placeholders::_2));
++  CMD2_ANY         ("network.receive_buffer.size",     std::bind(&torrent::ConnectionManager::receive_buffer_size, cm));
++  CMD2_ANY_VALUE_V ("network.receive_buffer.size.set", std::bind(&torrent::ConnectionManager::set_receive_buffer_size, cm, std::placeholders::_2));
++  CMD2_ANY_STRING  ("network.tos.set",                 std::bind(&apply_tos, std::placeholders::_2));
++
++  CMD2_ANY         ("network.bind_address",        std::bind(&core::Manager::bind_address, control->core()));
++  CMD2_ANY_STRING_V("network.bind_address.set",    std::bind(&core::Manager::set_bind_address, control->core(), std::placeholders::_2));
++  CMD2_ANY         ("network.local_address",       std::bind(&core::Manager::local_address, control->core()));
++  CMD2_ANY_STRING_V("network.local_address.set",   std::bind(&core::Manager::set_local_address, control->core(), std::placeholders::_2));
++  CMD2_ANY         ("network.proxy_address",       std::bind(&core::Manager::proxy_address, control->core()));
++  CMD2_ANY_STRING_V("network.proxy_address.set",   std::bind(&core::Manager::set_proxy_address, control->core(), std::placeholders::_2));
++
++  CMD2_ANY         ("network.max_open_files",       std::bind(&torrent::FileManager::max_open_files, fileManager));
++  CMD2_ANY_VALUE_V ("network.max_open_files.set",   std::bind(&torrent::FileManager::set_max_open_files, fileManager, std::placeholders::_2));
++  CMD2_ANY         ("network.open_sockets",         std::bind(&torrent::ConnectionManager::size, cm));
++  CMD2_ANY         ("network.max_open_sockets",     std::bind(&torrent::ConnectionManager::max_size, cm));
++  CMD2_ANY_VALUE_V ("network.max_open_sockets.set", std::bind(&torrent::ConnectionManager::set_max_size, cm, std::placeholders::_2));
++
++  CMD2_ANY_STRING  ("network.scgi.open_port",   std::bind(&apply_scgi, std::placeholders::_2, 1));
++  CMD2_ANY_STRING  ("network.scgi.open_local",  std::bind(&apply_scgi, std::placeholders::_2, 2));
+   CMD2_VAR_BOOL    ("network.scgi.dont_route",  false);
+ 
+-  CMD2_ANY_STRING  ("network.xmlrpc.dialect.set",    tr1::bind(&apply_xmlrpc_dialect, tr1::placeholders::_2));
+-  CMD2_ANY         ("network.xmlrpc.size_limit",     tr1::bind(&rpc::XmlRpc::size_limit));
+-  CMD2_ANY_VALUE_V ("network.xmlrpc.size_limit.set", tr1::bind(&rpc::XmlRpc::set_size_limit, tr1::placeholders::_2));
++  CMD2_ANY_STRING  ("network.xmlrpc.dialect.set",    std::bind(&apply_xmlrpc_dialect, std::placeholders::_2));
++  CMD2_ANY         ("network.xmlrpc.size_limit",     std::bind(&rpc::XmlRpc::size_limit));
++  CMD2_ANY_VALUE_V ("network.xmlrpc.size_limit.set", std::bind(&rpc::XmlRpc::set_size_limit, std::placeholders::_2));
+ }
+--- src/command_peer.cc
++++ src/command_peer.cc
+@@ -97,37 +97,37 @@ retrieve_p_completed_percent(torrent::Peer* peer) {
+ 
+ void
+ initialize_command_peer() {
+-  CMD2_PEER("p.id",                tr1::bind(&retrieve_p_id, tr1::placeholders::_1));
+-  CMD2_PEER("p.id_html",           tr1::bind(&retrieve_p_id_html, tr1::placeholders::_1));
+-  CMD2_PEER("p.client_version",    tr1::bind(&retrieve_p_client_version, tr1::placeholders::_1));
++  CMD2_PEER("p.id",                std::bind(&retrieve_p_id, std::placeholders::_1));
++  CMD2_PEER("p.id_html",           std::bind(&retrieve_p_id_html, std::placeholders::_1));
++  CMD2_PEER("p.client_version",    std::bind(&retrieve_p_client_version, std::placeholders::_1));
+ 
+-  CMD2_PEER("p.options_str",       tr1::bind(&retrieve_p_options_str, tr1::placeholders::_1));
++  CMD2_PEER("p.options_str",       std::bind(&retrieve_p_options_str, std::placeholders::_1));
+ 
+-  CMD2_PEER("p.is_encrypted",      tr1::bind(&torrent::Peer::is_encrypted, tr1::placeholders::_1));
+-  CMD2_PEER("p.is_incoming",       tr1::bind(&torrent::Peer::is_incoming, tr1::placeholders::_1));
+-  CMD2_PEER("p.is_obfuscated",     tr1::bind(&torrent::Peer::is_obfuscated, tr1::placeholders::_1));
+-  CMD2_PEER("p.is_snubbed",        tr1::bind(&torrent::Peer::is_snubbed, tr1::placeholders::_1));
++  CMD2_PEER("p.is_encrypted",      std::bind(&torrent::Peer::is_encrypted, std::placeholders::_1));
++  CMD2_PEER("p.is_incoming",       std::bind(&torrent::Peer::is_incoming, std::placeholders::_1));
++  CMD2_PEER("p.is_obfuscated",     std::bind(&torrent::Peer::is_obfuscated, std::placeholders::_1));
++  CMD2_PEER("p.is_snubbed",        std::bind(&torrent::Peer::is_snubbed, std::placeholders::_1));
+ 
+-  CMD2_PEER("p.is_unwanted",       tr1::bind(&torrent::PeerInfo::is_unwanted,  tr1::bind(&torrent::Peer::peer_info, tr1::placeholders::_1)));
+-  CMD2_PEER("p.is_preferred",      tr1::bind(&torrent::PeerInfo::is_preferred, tr1::bind(&torrent::Peer::peer_info, tr1::placeholders::_1)));
++  CMD2_PEER("p.is_unwanted",       std::bind(&torrent::PeerInfo::is_unwanted,  std::bind(&torrent::Peer::peer_info, std::placeholders::_1)));
++  CMD2_PEER("p.is_preferred",      std::bind(&torrent::PeerInfo::is_preferred, std::bind(&torrent::Peer::peer_info, std::placeholders::_1)));
+ 
+-  CMD2_PEER("p.address",           tr1::bind(&retrieve_p_address, tr1::placeholders::_1));
+-  CMD2_PEER("p.port",              tr1::bind(&retrieve_p_port, tr1::placeholders::_1));
++  CMD2_PEER("p.address",           std::bind(&retrieve_p_address, std::placeholders::_1));
++  CMD2_PEER("p.port",              std::bind(&retrieve_p_port, std::placeholders::_1));
+ 
+-  CMD2_PEER("p.completed_percent", tr1::bind(&retrieve_p_completed_percent, tr1::placeholders::_1));
++  CMD2_PEER("p.completed_percent", std::bind(&retrieve_p_completed_percent, std::placeholders::_1));
+ 
+-  CMD2_PEER("p.up_rate",           tr1::bind(&torrent::Rate::rate,  tr1::bind(&torrent::Peer::up_rate, tr1::placeholders::_1)));
+-  CMD2_PEER("p.up_total",          tr1::bind(&torrent::Rate::total, tr1::bind(&torrent::Peer::up_rate, tr1::placeholders::_1)));
+-  CMD2_PEER("p.down_rate",         tr1::bind(&torrent::Rate::rate,  tr1::bind(&torrent::Peer::down_rate, tr1::placeholders::_1)));
+-  CMD2_PEER("p.down_total",        tr1::bind(&torrent::Rate::total, tr1::bind(&torrent::Peer::down_rate, tr1::placeholders::_1)));
+-  CMD2_PEER("p.peer_rate",         tr1::bind(&torrent::Rate::rate,  tr1::bind(&torrent::Peer::peer_rate, tr1::placeholders::_1)));
+-  CMD2_PEER("p.peer_total",        tr1::bind(&torrent::Rate::total, tr1::bind(&torrent::Peer::peer_rate, tr1::placeholders::_1)));
++  CMD2_PEER("p.up_rate",           std::bind(&torrent::Rate::rate,  std::bind(&torrent::Peer::up_rate, std::placeholders::_1)));
++  CMD2_PEER("p.up_total",          std::bind(&torrent::Rate::total, std::bind(&torrent::Peer::up_rate, std::placeholders::_1)));
++  CMD2_PEER("p.down_rate",         std::bind(&torrent::Rate::rate,  std::bind(&torrent::Peer::down_rate, std::placeholders::_1)));
++  CMD2_PEER("p.down_total",        std::bind(&torrent::Rate::total, std::bind(&torrent::Peer::down_rate, std::placeholders::_1)));
++  CMD2_PEER("p.peer_rate",         std::bind(&torrent::Rate::rate,  std::bind(&torrent::Peer::peer_rate, std::placeholders::_1)));
++  CMD2_PEER("p.peer_total",        std::bind(&torrent::Rate::total, std::bind(&torrent::Peer::peer_rate, std::placeholders::_1)));
+ 
+-  CMD2_PEER        ("p.snubbed",     tr1::bind(&torrent::Peer::is_snubbed,  tr1::placeholders::_1));
+-  CMD2_PEER_VALUE_V("p.snubbed.set", tr1::bind(&torrent::Peer::set_snubbed, tr1::placeholders::_1, tr1::placeholders::_2));
+-  CMD2_PEER        ("p.banned",      tr1::bind(&torrent::Peer::is_banned,   tr1::placeholders::_1));
+-  CMD2_PEER_VALUE_V("p.banned.set",  tr1::bind(&torrent::Peer::set_banned,  tr1::placeholders::_1, tr1::placeholders::_2));
++  CMD2_PEER        ("p.snubbed",     std::bind(&torrent::Peer::is_snubbed,  std::placeholders::_1));
++  CMD2_PEER_VALUE_V("p.snubbed.set", std::bind(&torrent::Peer::set_snubbed, std::placeholders::_1, std::placeholders::_2));
++  CMD2_PEER        ("p.banned",      std::bind(&torrent::Peer::is_banned,   std::placeholders::_1));
++  CMD2_PEER_VALUE_V("p.banned.set",  std::bind(&torrent::Peer::set_banned,  std::placeholders::_1, std::placeholders::_2));
+ 
+-  CMD2_PEER_V("p.disconnect",         tr1::bind(&torrent::Peer::disconnect, tr1::placeholders::_1, 0));
+-  CMD2_PEER_V("p.disconnect_delayed", tr1::bind(&torrent::Peer::disconnect, tr1::placeholders::_1, torrent::ConnectionList::disconnect_delayed));
++  CMD2_PEER_V("p.disconnect",         std::bind(&torrent::Peer::disconnect, std::placeholders::_1, 0));
++  CMD2_PEER_V("p.disconnect_delayed", std::bind(&torrent::Peer::disconnect, std::placeholders::_1, torrent::ConnectionList::disconnect_delayed));
+ }
+--- src/command_scheduler.cc
++++ src/command_scheduler.cc
+@@ -115,7 +115,7 @@ void
+ initialize_command_scheduler() {
+   CMD2_VAR_VALUE("scheduler.max_active", int64_t(-1));
+ 
+-  CMD2_DL("scheduler.simple.added",   tr1::bind(&cmd_scheduler_simple_added, tr1::placeholders::_1));
+-  CMD2_DL("scheduler.simple.removed", tr1::bind(&cmd_scheduler_simple_removed, tr1::placeholders::_1));
+-  CMD2_DL("scheduler.simple.update",  tr1::bind(&cmd_scheduler_simple_update, tr1::placeholders::_1));
++  CMD2_DL("scheduler.simple.added",   std::bind(&cmd_scheduler_simple_added, std::placeholders::_1));
++  CMD2_DL("scheduler.simple.removed", std::bind(&cmd_scheduler_simple_removed, std::placeholders::_1));
++  CMD2_DL("scheduler.simple.update",  std::bind(&cmd_scheduler_simple_update, std::placeholders::_1));
+ }
+--- src/command_throttle.cc
++++ src/command_throttle.cc
+@@ -173,8 +173,8 @@ throttle_update(const char* variable, int64_t value) {
+ 
+ void
+ initialize_command_throttle() {
+-  CMD2_ANY         ("throttle.unchoked_uploads",   tr1::bind(&torrent::ResourceManager::currently_upload_unchoked, torrent::resource_manager()));
+-  CMD2_ANY         ("throttle.unchoked_downloads", tr1::bind(&torrent::ResourceManager::currently_download_unchoked, torrent::resource_manager()));
++  CMD2_ANY         ("throttle.unchoked_uploads",   std::bind(&torrent::ResourceManager::currently_upload_unchoked, torrent::resource_manager()));
++  CMD2_ANY         ("throttle.unchoked_downloads", std::bind(&torrent::ResourceManager::currently_download_unchoked, torrent::resource_manager()));
+ 
+   CMD2_VAR_VALUE   ("throttle.min_peers.normal", 100);
+   CMD2_VAR_VALUE   ("throttle.max_peers.normal", 200);
+@@ -196,31 +196,31 @@ initialize_command_throttle() {
+   CMD2_REDIRECT_GENERIC("throttle.max_downloads.div",    "throttle.max_downloads.div._val");
+   CMD2_REDIRECT_GENERIC("throttle.max_downloads.global", "throttle.max_downloads.global._val");
+ 
+-  CMD2_ANY_VALUE   ("throttle.max_uploads.div.set",      tr1::bind(&throttle_update, "throttle.max_uploads.div._val.set", tr1::placeholders::_2));
+-  CMD2_ANY_VALUE   ("throttle.max_uploads.global.set",   tr1::bind(&throttle_update, "throttle.max_uploads.global._val.set", tr1::placeholders::_2));
+-  CMD2_ANY_VALUE   ("throttle.max_downloads.div.set",    tr1::bind(&throttle_update, "throttle.max_downloads.div._val.set", tr1::placeholders::_2));
+-  CMD2_ANY_VALUE   ("throttle.max_downloads.global.set", tr1::bind(&throttle_update, "throttle.max_downloads.global._val.set", tr1::placeholders::_2));
++  CMD2_ANY_VALUE   ("throttle.max_uploads.div.set",      std::bind(&throttle_update, "throttle.max_uploads.div._val.set", std::placeholders::_2));
++  CMD2_ANY_VALUE   ("throttle.max_uploads.global.set",   std::bind(&throttle_update, "throttle.max_uploads.global._val.set", std::placeholders::_2));
++  CMD2_ANY_VALUE   ("throttle.max_downloads.div.set",    std::bind(&throttle_update, "throttle.max_downloads.div._val.set", std::placeholders::_2));
++  CMD2_ANY_VALUE   ("throttle.max_downloads.global.set", std::bind(&throttle_update, "throttle.max_downloads.global._val.set", std::placeholders::_2));
+ 
+   // TODO: Move the logic into some libtorrent function.
+-  CMD2_ANY         ("throttle.global_up.rate",              tr1::bind(&torrent::Rate::rate, torrent::up_rate()));
+-  CMD2_ANY         ("throttle.global_up.total",             tr1::bind(&torrent::Rate::total, torrent::up_rate()));
+-  CMD2_ANY         ("throttle.global_up.max_rate",          tr1::bind(&torrent::Throttle::max_rate, torrent::up_throttle_global()));
+-  CMD2_ANY_VALUE_V ("throttle.global_up.max_rate.set",      tr1::bind(&ui::Root::set_up_throttle_i64, control->ui(), tr1::placeholders::_2));
+-  CMD2_ANY_VALUE_KB("throttle.global_up.max_rate.set_kb",   tr1::bind(&ui::Root::set_up_throttle_i64, control->ui(), tr1::placeholders::_2));
+-  CMD2_ANY         ("throttle.global_down.rate",            tr1::bind(&torrent::Rate::rate, torrent::down_rate()));
+-  CMD2_ANY         ("throttle.global_down.total",           tr1::bind(&torrent::Rate::total, torrent::down_rate()));
+-  CMD2_ANY         ("throttle.global_down.max_rate",        tr1::bind(&torrent::Throttle::max_rate, torrent::down_throttle_global()));
+-  CMD2_ANY_VALUE_V ("throttle.global_down.max_rate.set",    tr1::bind(&ui::Root::set_down_throttle_i64, control->ui(), tr1::placeholders::_2));
+-  CMD2_ANY_VALUE_KB("throttle.global_down.max_rate.set_kb", tr1::bind(&ui::Root::set_down_throttle_i64, control->ui(), tr1::placeholders::_2));
++  CMD2_ANY         ("throttle.global_up.rate",              std::bind(&torrent::Rate::rate, torrent::up_rate()));
++  CMD2_ANY         ("throttle.global_up.total",             std::bind(&torrent::Rate::total, torrent::up_rate()));
++  CMD2_ANY         ("throttle.global_up.max_rate",          std::bind(&torrent::Throttle::max_rate, torrent::up_throttle_global()));
++  CMD2_ANY_VALUE_V ("throttle.global_up.max_rate.set",      std::bind(&ui::Root::set_up_throttle_i64, control->ui(), std::placeholders::_2));
++  CMD2_ANY_VALUE_KB("throttle.global_up.max_rate.set_kb",   std::bind(&ui::Root::set_up_throttle_i64, control->ui(), std::placeholders::_2));
++  CMD2_ANY         ("throttle.global_down.rate",            std::bind(&torrent::Rate::rate, torrent::down_rate()));
++  CMD2_ANY         ("throttle.global_down.total",           std::bind(&torrent::Rate::total, torrent::down_rate()));
++  CMD2_ANY         ("throttle.global_down.max_rate",        std::bind(&torrent::Throttle::max_rate, torrent::down_throttle_global()));
++  CMD2_ANY_VALUE_V ("throttle.global_down.max_rate.set",    std::bind(&ui::Root::set_down_throttle_i64, control->ui(), std::placeholders::_2));
++  CMD2_ANY_VALUE_KB("throttle.global_down.max_rate.set_kb", std::bind(&ui::Root::set_down_throttle_i64, control->ui(), std::placeholders::_2));
+ 
+   // Temporary names, need to change this to accept real rates rather
+   // than kB.
+-  CMD2_ANY_LIST    ("throttle.up",                          tr1::bind(&apply_throttle, tr1::placeholders::_2, true));
+-  CMD2_ANY_LIST    ("throttle.down",                        tr1::bind(&apply_throttle, tr1::placeholders::_2, false));
+-  CMD2_ANY_LIST    ("throttle.ip",                          tr1::bind(&apply_address_throttle, tr1::placeholders::_2));
+-
+-  CMD2_ANY_STRING  ("throttle.up.max",    tr1::bind(&retrieve_throttle_info, tr1::placeholders::_2, throttle_info_up | throttle_info_max));
+-  CMD2_ANY_STRING  ("throttle.up.rate",   tr1::bind(&retrieve_throttle_info, tr1::placeholders::_2, throttle_info_up | throttle_info_rate));
+-  CMD2_ANY_STRING  ("throttle.down.max",  tr1::bind(&retrieve_throttle_info, tr1::placeholders::_2, throttle_info_down | throttle_info_max));
+-  CMD2_ANY_STRING  ("throttle.down.rate", tr1::bind(&retrieve_throttle_info, tr1::placeholders::_2, throttle_info_down | throttle_info_rate));
++  CMD2_ANY_LIST    ("throttle.up",                          std::bind(&apply_throttle, std::placeholders::_2, true));
++  CMD2_ANY_LIST    ("throttle.down",                        std::bind(&apply_throttle, std::placeholders::_2, false));
++  CMD2_ANY_LIST    ("throttle.ip",                          std::bind(&apply_address_throttle, std::placeholders::_2));
++
++  CMD2_ANY_STRING  ("throttle.up.max",    std::bind(&retrieve_throttle_info, std::placeholders::_2, throttle_info_up | throttle_info_max));
++  CMD2_ANY_STRING  ("throttle.up.rate",   std::bind(&retrieve_throttle_info, std::placeholders::_2, throttle_info_up | throttle_info_rate));
++  CMD2_ANY_STRING  ("throttle.down.max",  std::bind(&retrieve_throttle_info, std::placeholders::_2, throttle_info_down | throttle_info_max));
++  CMD2_ANY_STRING  ("throttle.down.rate", std::bind(&retrieve_throttle_info, std::placeholders::_2, throttle_info_down | throttle_info_rate));
+ }
+--- src/command_tracker.cc
++++ src/command_tracker.cc
+@@ -111,59 +111,59 @@ apply_enable_trackers(int64_t arg) {
+ 
+ void
+ initialize_command_tracker() {
+-  CMD2_TRACKER        ("t.is_open",           tr1::bind(&torrent::Tracker::is_busy, tr1::placeholders::_1));
+-  CMD2_TRACKER        ("t.is_enabled",        tr1::bind(&torrent::Tracker::is_enabled, tr1::placeholders::_1));
+-  CMD2_TRACKER        ("t.is_usable",         tr1::bind(&torrent::Tracker::is_usable, tr1::placeholders::_1));
+-  CMD2_TRACKER        ("t.is_busy",           tr1::bind(&torrent::Tracker::is_busy, tr1::placeholders::_1));
+-  CMD2_TRACKER        ("t.is_extra_tracker",  tr1::bind(&torrent::Tracker::is_extra_tracker, tr1::placeholders::_1));
+-  CMD2_TRACKER        ("t.can_scrape",        tr1::bind(&torrent::Tracker::can_scrape, tr1::placeholders::_1));
++  CMD2_TRACKER        ("t.is_open",           std::bind(&torrent::Tracker::is_busy, std::placeholders::_1));
++  CMD2_TRACKER        ("t.is_enabled",        std::bind(&torrent::Tracker::is_enabled, std::placeholders::_1));
++  CMD2_TRACKER        ("t.is_usable",         std::bind(&torrent::Tracker::is_usable, std::placeholders::_1));
++  CMD2_TRACKER        ("t.is_busy",           std::bind(&torrent::Tracker::is_busy, std::placeholders::_1));
++  CMD2_TRACKER        ("t.is_extra_tracker",  std::bind(&torrent::Tracker::is_extra_tracker, std::placeholders::_1));
++  CMD2_TRACKER        ("t.can_scrape",        std::bind(&torrent::Tracker::can_scrape, std::placeholders::_1));
+ 
+-  CMD2_TRACKER_V      ("t.enable",            tr1::bind(&torrent::Tracker::enable, tr1::placeholders::_1));
+-  CMD2_TRACKER_V      ("t.disable",           tr1::bind(&torrent::Tracker::disable, tr1::placeholders::_1));
++  CMD2_TRACKER_V      ("t.enable",            std::bind(&torrent::Tracker::enable, std::placeholders::_1));
++  CMD2_TRACKER_V      ("t.disable",           std::bind(&torrent::Tracker::disable, std::placeholders::_1));
+ 
+-  CMD2_TRACKER_VALUE_V("t.is_enabled.set",    tr1::bind(&tracker_set_enabled, tr1::placeholders::_1, tr1::placeholders::_2));
++  CMD2_TRACKER_VALUE_V("t.is_enabled.set",    std::bind(&tracker_set_enabled, std::placeholders::_1, std::placeholders::_2));
+ 
+-  CMD2_TRACKER        ("t.url",               tr1::bind(&torrent::Tracker::url, tr1::placeholders::_1));
+-  CMD2_TRACKER        ("t.group",             tr1::bind(&torrent::Tracker::group, tr1::placeholders::_1));
+-  CMD2_TRACKER        ("t.type",              tr1::bind(&torrent::Tracker::type, tr1::placeholders::_1));
+-  CMD2_TRACKER        ("t.id",                tr1::bind(&torrent::Tracker::tracker_id, tr1::placeholders::_1));
++  CMD2_TRACKER        ("t.url",               std::bind(&torrent::Tracker::url, std::placeholders::_1));
++  CMD2_TRACKER        ("t.group",             std::bind(&torrent::Tracker::group, std::placeholders::_1));
++  CMD2_TRACKER        ("t.type",              std::bind(&torrent::Tracker::type, std::placeholders::_1));
++  CMD2_TRACKER        ("t.id",                std::bind(&torrent::Tracker::tracker_id, std::placeholders::_1));
+ 
+-  CMD2_TRACKER        ("t.latest_event",      tr1::bind(&torrent::Tracker::latest_event, tr1::placeholders::_1));
+-  CMD2_TRACKER        ("t.latest_new_peers",  tr1::bind(&torrent::Tracker::latest_new_peers, tr1::placeholders::_1));
+-  CMD2_TRACKER        ("t.latest_sum_peers",  tr1::bind(&torrent::Tracker::latest_sum_peers, tr1::placeholders::_1));
++  CMD2_TRACKER        ("t.latest_event",      std::bind(&torrent::Tracker::latest_event, std::placeholders::_1));
++  CMD2_TRACKER        ("t.latest_new_peers",  std::bind(&torrent::Tracker::latest_new_peers, std::placeholders::_1));
++  CMD2_TRACKER        ("t.latest_sum_peers",  std::bind(&torrent::Tracker::latest_sum_peers, std::placeholders::_1));
+ 
+   // Time since last connection, connection attempt.
+ 
+-  CMD2_TRACKER        ("t.normal_interval",   tr1::bind(&torrent::Tracker::normal_interval, tr1::placeholders::_1));
+-  CMD2_TRACKER        ("t.min_interval",      tr1::bind(&torrent::Tracker::min_interval, tr1::placeholders::_1));
++  CMD2_TRACKER        ("t.normal_interval",   std::bind(&torrent::Tracker::normal_interval, std::placeholders::_1));
++  CMD2_TRACKER        ("t.min_interval",      std::bind(&torrent::Tracker::min_interval, std::placeholders::_1));
+ 
+-  CMD2_TRACKER        ("t.activity_time_next", tr1::bind(&torrent::Tracker::activity_time_next, tr1::placeholders::_1));
+-  CMD2_TRACKER        ("t.activity_time_last", tr1::bind(&torrent::Tracker::activity_time_last, tr1::placeholders::_1));
++  CMD2_TRACKER        ("t.activity_time_next", std::bind(&torrent::Tracker::activity_time_next, std::placeholders::_1));
++  CMD2_TRACKER        ("t.activity_time_last", std::bind(&torrent::Tracker::activity_time_last, std::placeholders::_1));
+ 
+-  CMD2_TRACKER        ("t.success_time_next", tr1::bind(&torrent::Tracker::success_time_next, tr1::placeholders::_1));
+-  CMD2_TRACKER        ("t.success_time_last", tr1::bind(&torrent::Tracker::success_time_last, tr1::placeholders::_1));
+-  CMD2_TRACKER        ("t.success_counter",   tr1::bind(&torrent::Tracker::success_counter, tr1::placeholders::_1));
++  CMD2_TRACKER        ("t.success_time_next", std::bind(&torrent::Tracker::success_time_next, std::placeholders::_1));
++  CMD2_TRACKER        ("t.success_time_last", std::bind(&torrent::Tracker::success_time_last, std::placeholders::_1));
++  CMD2_TRACKER        ("t.success_counter",   std::bind(&torrent::Tracker::success_counter, std::placeholders::_1));
+ 
+-  CMD2_TRACKER        ("t.failed_time_next",  tr1::bind(&torrent::Tracker::failed_time_next, tr1::placeholders::_1));
+-  CMD2_TRACKER        ("t.failed_time_last",  tr1::bind(&torrent::Tracker::failed_time_last, tr1::placeholders::_1));
+-  CMD2_TRACKER        ("t.failed_counter",    tr1::bind(&torrent::Tracker::failed_counter, tr1::placeholders::_1));
++  CMD2_TRACKER        ("t.failed_time_next",  std::bind(&torrent::Tracker::failed_time_next, std::placeholders::_1));
++  CMD2_TRACKER        ("t.failed_time_last",  std::bind(&torrent::Tracker::failed_time_last, std::placeholders::_1));
++  CMD2_TRACKER        ("t.failed_counter",    std::bind(&torrent::Tracker::failed_counter, std::placeholders::_1));
+ 
+-  CMD2_TRACKER        ("t.scrape_time_last",  tr1::bind(&torrent::Tracker::scrape_time_last, tr1::placeholders::_1));
+-  CMD2_TRACKER        ("t.scrape_counter",    tr1::bind(&torrent::Tracker::scrape_counter, tr1::placeholders::_1));
++  CMD2_TRACKER        ("t.scrape_time_last",  std::bind(&torrent::Tracker::scrape_time_last, std::placeholders::_1));
++  CMD2_TRACKER        ("t.scrape_counter",    std::bind(&torrent::Tracker::scrape_counter, std::placeholders::_1));
+ 
+-  CMD2_TRACKER        ("t.scrape_complete",   tr1::bind(&torrent::Tracker::scrape_complete, tr1::placeholders::_1));
+-  CMD2_TRACKER        ("t.scrape_incomplete", tr1::bind(&torrent::Tracker::scrape_incomplete, tr1::placeholders::_1));
+-  CMD2_TRACKER        ("t.scrape_downloaded", tr1::bind(&torrent::Tracker::scrape_downloaded, tr1::placeholders::_1));
++  CMD2_TRACKER        ("t.scrape_complete",   std::bind(&torrent::Tracker::scrape_complete, std::placeholders::_1));
++  CMD2_TRACKER        ("t.scrape_incomplete", std::bind(&torrent::Tracker::scrape_incomplete, std::placeholders::_1));
++  CMD2_TRACKER        ("t.scrape_downloaded", std::bind(&torrent::Tracker::scrape_downloaded, std::placeholders::_1));
+ 
+-  CMD2_ANY_VALUE      ("trackers.enable",     tr1::bind(&apply_enable_trackers, int64_t(1)));
+-  CMD2_ANY_VALUE      ("trackers.disable",    tr1::bind(&apply_enable_trackers, int64_t(0)));
++  CMD2_ANY_VALUE      ("trackers.enable",     std::bind(&apply_enable_trackers, int64_t(1)));
++  CMD2_ANY_VALUE      ("trackers.disable",    std::bind(&apply_enable_trackers, int64_t(0)));
+   CMD2_VAR_VALUE      ("trackers.numwant",    -1);
+   CMD2_VAR_BOOL       ("trackers.use_udp",    true);
+ 
+-  CMD2_ANY_STRING_V   ("dht.mode.set",          tr1::bind(&core::DhtManager::set_mode, control->dht_manager(), tr1::placeholders::_2));
++  CMD2_ANY_STRING_V   ("dht.mode.set",          std::bind(&core::DhtManager::set_mode, control->dht_manager(), std::placeholders::_2));
+   CMD2_VAR_VALUE      ("dht.port",              int64_t(6881));
+-  CMD2_ANY_STRING     ("dht.add_node",          tr1::bind(&apply_dht_add_node, tr1::placeholders::_2));
+-  CMD2_ANY            ("dht.statistics",        tr1::bind(&core::DhtManager::dht_statistics, control->dht_manager()));
+-  CMD2_ANY            ("dht.throttle.name",     tr1::bind(&core::DhtManager::throttle_name, control->dht_manager()));
+-  CMD2_ANY_STRING_V   ("dht.throttle.name.set", tr1::bind(&core::DhtManager::set_throttle_name, control->dht_manager(), tr1::placeholders::_2));
++  CMD2_ANY_STRING     ("dht.add_node",          std::bind(&apply_dht_add_node, std::placeholders::_2));
++  CMD2_ANY            ("dht.statistics",        std::bind(&core::DhtManager::dht_statistics, control->dht_manager()));
++  CMD2_ANY            ("dht.throttle.name",     std::bind(&core::DhtManager::throttle_name, control->dht_manager()));
++  CMD2_ANY_STRING_V   ("dht.throttle.name.set", std::bind(&core::DhtManager::set_throttle_name, control->dht_manager(), std::placeholders::_2));
+ }
+--- src/command_ui.cc
++++ src/command_ui.cc
+@@ -519,41 +519,41 @@ void
+ initialize_command_ui() {
+   CMD2_VAR_STRING("keys.layout", "qwerty");
+ 
+-  CMD2_ANY_STRING("view.add", object_convert_void(tr1::bind(&core::ViewManager::insert_throw, control->view_manager(), tr1::placeholders::_2)));
++  CMD2_ANY_STRING("view.add", object_convert_void(std::bind(&core::ViewManager::insert_throw, control->view_manager(), std::placeholders::_2)));
+ 
+-  CMD2_ANY_L   ("view.list",          tr1::bind(&apply_view_list));
+-  CMD2_ANY_LIST("view.set",           tr1::bind(&apply_view_set, tr1::placeholders::_2));
++  CMD2_ANY_L   ("view.list",          std::bind(&apply_view_list));
++  CMD2_ANY_LIST("view.set",           std::bind(&apply_view_set, std::placeholders::_2));
+ 
+-  CMD2_ANY_LIST("view.filter",        tr1::bind(&apply_view_event, &core::ViewManager::set_filter, tr1::placeholders::_2));
+-  CMD2_ANY_LIST("view.filter_on",     tr1::bind(&apply_view_filter_on, tr1::placeholders::_2));
++  CMD2_ANY_LIST("view.filter",        std::bind(&apply_view_event, &core::ViewManager::set_filter, std::placeholders::_2));
++  CMD2_ANY_LIST("view.filter_on",     std::bind(&apply_view_filter_on, std::placeholders::_2));
+ 
+-  CMD2_ANY_LIST("view.sort",          tr1::bind(&apply_view_sort, tr1::placeholders::_2));
+-  CMD2_ANY_LIST("view.sort_new",      tr1::bind(&apply_view_event, &core::ViewManager::set_sort_new, tr1::placeholders::_2));
+-  CMD2_ANY_LIST("view.sort_current",  tr1::bind(&apply_view_event, &core::ViewManager::set_sort_current, tr1::placeholders::_2));
++  CMD2_ANY_LIST("view.sort",          std::bind(&apply_view_sort, std::placeholders::_2));
++  CMD2_ANY_LIST("view.sort_new",      std::bind(&apply_view_event, &core::ViewManager::set_sort_new, std::placeholders::_2));
++  CMD2_ANY_LIST("view.sort_current",  std::bind(&apply_view_event, &core::ViewManager::set_sort_current, std::placeholders::_2));
+ 
+-  CMD2_ANY_LIST("view.event_added",   tr1::bind(&apply_view_event, &core::ViewManager::set_event_added, tr1::placeholders::_2));
+-  CMD2_ANY_LIST("view.event_removed", tr1::bind(&apply_view_event, &core::ViewManager::set_event_removed, tr1::placeholders::_2));
++  CMD2_ANY_LIST("view.event_added",   std::bind(&apply_view_event, &core::ViewManager::set_event_added, std::placeholders::_2));
++  CMD2_ANY_LIST("view.event_removed", std::bind(&apply_view_event, &core::ViewManager::set_event_removed, std::placeholders::_2));
+ 
+   // Cleanup and add . to view.
+ 
+-  CMD2_ANY_STRING("view.size",              tr1::bind(&cmd_view_size, tr1::placeholders::_2));
+-  CMD2_ANY_STRING("view.size_not_visible",  tr1::bind(&cmd_view_size_not_visible, tr1::placeholders::_2));
+-  CMD2_ANY_STRING("view.persistent",        tr1::bind(&cmd_view_persistent, tr1::placeholders::_2));
++  CMD2_ANY_STRING("view.size",              std::bind(&cmd_view_size, std::placeholders::_2));
++  CMD2_ANY_STRING("view.size_not_visible",  std::bind(&cmd_view_size_not_visible, std::placeholders::_2));
++  CMD2_ANY_STRING("view.persistent",        std::bind(&cmd_view_persistent, std::placeholders::_2));
+ 
+-  CMD2_ANY_STRING_V("view.filter_all",      tr1::bind(&core::View::filter, tr1::bind(&core::ViewManager::find_ptr_throw, control->view_manager(), tr1::placeholders::_2)));
++  CMD2_ANY_STRING_V("view.filter_all",      std::bind(&core::View::filter, std::bind(&core::ViewManager::find_ptr_throw, control->view_manager(), std::placeholders::_2)));
+ 
+-  CMD2_DL_STRING ("view.filter_download", tr1::bind(&cmd_view_filter_download, tr1::placeholders::_1, tr1::placeholders::_2));
+-  CMD2_DL_STRING ("view.set_visible",     tr1::bind(&cmd_view_set_visible,     tr1::placeholders::_1, tr1::placeholders::_2));
+-  CMD2_DL_STRING ("view.set_not_visible", tr1::bind(&cmd_view_set_not_visible, tr1::placeholders::_1, tr1::placeholders::_2));
++  CMD2_DL_STRING ("view.filter_download", std::bind(&cmd_view_filter_download, std::placeholders::_1, std::placeholders::_2));
++  CMD2_DL_STRING ("view.set_visible",     std::bind(&cmd_view_set_visible,     std::placeholders::_1, std::placeholders::_2));
++  CMD2_DL_STRING ("view.set_not_visible", std::bind(&cmd_view_set_not_visible, std::placeholders::_1, std::placeholders::_2));
+ 
+   // Commands that affect the default rtorrent UI.
+-  CMD2_DL        ("ui.unfocus_download",   tr1::bind(&cmd_ui_unfocus_download, tr1::placeholders::_1));
+-  CMD2_ANY_STRING("ui.current_view.set",   tr1::bind(&cmd_ui_set_view, tr1::placeholders::_2));
++  CMD2_DL        ("ui.unfocus_download",   std::bind(&cmd_ui_unfocus_download, std::placeholders::_1));
++  CMD2_ANY_STRING("ui.current_view.set",   std::bind(&cmd_ui_set_view, std::placeholders::_2));
+ 
+   // Move.
+   CMD2_ANY("print", &apply_print);
+   CMD2_ANY("cat",   &apply_cat);
+-  CMD2_ANY("if",    tr1::bind(&apply_if, tr1::placeholders::_1, tr1::placeholders::_2, 0));
++  CMD2_ANY("if",    std::bind(&apply_if, std::placeholders::_1, std::placeholders::_2, 0));
+   CMD2_ANY("not",   &apply_not);
+   CMD2_ANY("false", &apply_false);
+   CMD2_ANY("and",   &apply_and);
+@@ -561,22 +561,22 @@ initialize_command_ui() {
+ 
+   // A temporary command for handling stuff until we get proper
+   // support for seperation of commands and literals.
+-  CMD2_ANY("branch", tr1::bind(&apply_if, tr1::placeholders::_1, tr1::placeholders::_2, 1));
++  CMD2_ANY("branch", std::bind(&apply_if, std::placeholders::_1, std::placeholders::_2, 1));
+ 
+   CMD2_ANY_LIST("less",    &apply_less);
+   CMD2_ANY_LIST("greater", &apply_greater);
+   CMD2_ANY_LIST("equal",   &apply_equal);
+ 
+-  CMD2_ANY_VALUE("convert.gm_time",      tr1::bind(&apply_to_time, tr1::placeholders::_2, 0));
+-  CMD2_ANY_VALUE("convert.gm_date",      tr1::bind(&apply_to_time, tr1::placeholders::_2, 0x2));
+-  CMD2_ANY_VALUE("convert.time",         tr1::bind(&apply_to_time, tr1::placeholders::_2, 0x1));
+-  CMD2_ANY_VALUE("convert.date",         tr1::bind(&apply_to_time, tr1::placeholders::_2, 0x1 | 0x2));
+-  CMD2_ANY_VALUE("convert.elapsed_time", tr1::bind(&apply_to_elapsed_time, tr1::placeholders::_2));
+-  CMD2_ANY_VALUE("convert.kb",           tr1::bind(&apply_to_kb, tr1::placeholders::_2));
+-  CMD2_ANY_VALUE("convert.mb",           tr1::bind(&apply_to_mb, tr1::placeholders::_2));
+-  CMD2_ANY_VALUE("convert.xb",           tr1::bind(&apply_to_xb, tr1::placeholders::_2));
+-  CMD2_ANY_VALUE("convert.throttle",     tr1::bind(&apply_to_throttle, tr1::placeholders::_2));
+-
+-  CMD2_ANY_LIST ("elapsed.less",         tr1::bind(&apply_elapsed_less, tr1::placeholders::_2));
+-  CMD2_ANY_LIST ("elapsed.greater",      tr1::bind(&apply_elapsed_greater, tr1::placeholders::_2));
++  CMD2_ANY_VALUE("convert.gm_time",      std::bind(&apply_to_time, std::placeholders::_2, 0));
++  CMD2_ANY_VALUE("convert.gm_date",      std::bind(&apply_to_time, std::placeholders::_2, 0x2));
++  CMD2_ANY_VALUE("convert.time",         std::bind(&apply_to_time, std::placeholders::_2, 0x1));
++  CMD2_ANY_VALUE("convert.date",         std::bind(&apply_to_time, std::placeholders::_2, 0x1 | 0x2));
++  CMD2_ANY_VALUE("convert.elapsed_time", std::bind(&apply_to_elapsed_time, std::placeholders::_2));
++  CMD2_ANY_VALUE("convert.kb",           std::bind(&apply_to_kb, std::placeholders::_2));
++  CMD2_ANY_VALUE("convert.mb",           std::bind(&apply_to_mb, std::placeholders::_2));
++  CMD2_ANY_VALUE("convert.xb",           std::bind(&apply_to_xb, std::placeholders::_2));
++  CMD2_ANY_VALUE("convert.throttle",     std::bind(&apply_to_throttle, std::placeholders::_2));
++
++  CMD2_ANY_LIST ("elapsed.less",         std::bind(&apply_elapsed_less, std::placeholders::_2));
++  CMD2_ANY_LIST ("elapsed.greater",      std::bind(&apply_elapsed_greater, std::placeholders::_2));
+ }
+--- src/control.cc
++++ src/control.cc
+@@ -78,7 +78,7 @@ Control::Control() :
+ 
+   m_inputStdin->slot_pressed(sigc::mem_fun(m_input, &input::Manager::pressed));
+ 
+-  m_taskShutdown.slot() = std::tr1::bind(&Control::handle_shutdown, this);
++  m_taskShutdown.slot() = std::bind(&Control::handle_shutdown, this);
+ 
+   m_commandScheduler->set_slot_error_message(rak::mem_fn(m_core, &core::Manager::push_log_std));
+ }
+--- src/core/curl_get.cc
++++ src/core/curl_get.cc
+@@ -82,7 +82,7 @@ CurlGet::start() {
+ 
+     // Normally libcurl should handle the timeout. But sometimes that doesn't
+     // work right so we do a fallback timeout that just aborts the transfer.
+-    m_taskTimeout.slot() = std::tr1::bind(&CurlGet::receive_timeout, this);
++    m_taskTimeout.slot() = std::bind(&CurlGet::receive_timeout, this);
+     priority_queue_erase(&taskScheduler, &m_taskTimeout);
+     priority_queue_insert(&taskScheduler, &m_taskTimeout, cachedTime + rak::timer::from_seconds(m_timeout + 5));
+   }
+--- src/core/curl_stack.cc
++++ src/core/curl_stack.cc
+@@ -55,7 +55,7 @@ CurlStack::CurlStack() :
+   m_ssl_verify_peer(true),
+   m_dns_timeout(60) {
+ 
+-  m_taskTimeout.slot() = std::tr1::bind(&CurlStack::receive_timeout, this);
++  m_taskTimeout.slot() = std::bind(&CurlStack::receive_timeout, this);
+ 
+ #if (LIBCURL_VERSION_NUM >= 0x071000)
+   curl_multi_setopt((CURLM*)m_handle, CURLMOPT_TIMERDATA, this);
+--- src/core/dht_manager.cc
++++ src/core/dht_manager.cc
+@@ -114,7 +114,7 @@ DhtManager::start_dht() {
+     torrent::dht_manager()->start(port);
+     torrent::dht_manager()->reset_statistics();
+ 
+-    m_updateTimeout.slot() = std::tr1::bind(&DhtManager::update, this);
++    m_updateTimeout.slot() = std::bind(&DhtManager::update, this);
+     priority_queue_insert(&taskScheduler, &m_updateTimeout, (cachedTime + rak::timer::from_seconds(60)).round_seconds());
+ 
+     m_dhtPrevCycle = 0;
+@@ -197,7 +197,7 @@ DhtManager::update() {
+         break;
+       
+     if (itr == end) {
+-      m_stopTimeout.slot() = std::tr1::bind(&DhtManager::stop_dht, this);
++      m_stopTimeout.slot() = std::bind(&DhtManager::stop_dht, this);
+       priority_queue_insert(&taskScheduler, &m_stopTimeout, (cachedTime + rak::timer::from_seconds(15 * 60)).round_seconds());
+     }
+   }
+--- src/core/download.cc
++++ src/core/download.cc
+@@ -63,10 +63,10 @@ Download::Download(download_type d) :
+   m_resumeFlags(~uint32_t()),
+   m_group(0) {
+ 
+-  m_download.info()->signal_tracker_success().push_back(tr1::bind(&Download::receive_tracker_msg, this, ""));
+-  m_download.info()->signal_tracker_failed().push_back(tr1::bind(&Download::receive_tracker_msg, this, tr1::placeholders::_1));
+-  m_download.info()->signal_storage_error().push_back(tr1::bind(&Download::receive_storage_error, this, tr1::placeholders::_1));
+-  m_download.info()->signal_chunk_failed().push_back(tr1::bind(&Download::receive_chunk_failed, this, tr1::placeholders::_1));
++  m_download.info()->signal_tracker_success().push_back(std::bind(&Download::receive_tracker_msg, this, ""));
++  m_download.info()->signal_tracker_failed().push_back(std::bind(&Download::receive_tracker_msg, this, std::placeholders::_1));
++  m_download.info()->signal_storage_error().push_back(std::bind(&Download::receive_storage_error, this, std::placeholders::_1));
++  m_download.info()->signal_chunk_failed().push_back(std::bind(&Download::receive_chunk_failed, this, std::placeholders::_1));
+ }
+ 
+ Download::~Download() {
+--- src/core/download_factory.cc
++++ src/core/download_factory.cc
+@@ -41,7 +41,7 @@
+ #include <sstream>
+ #include <stdexcept>
+ #include <rak/path.h>
+-#include <tr1/functional>
++#include <functional>
+ #include <torrent/utils/log.h>
+ #include <torrent/utils/resume.h>
+ #include <torrent/object.h>
+@@ -107,8 +107,8 @@ DownloadFactory::DownloadFactory(Manager* m) :
+   m_printLog(true),
+   m_isFile(false) {
+ 
+-  m_taskLoad.slot() = std::tr1::bind(&DownloadFactory::receive_load, this);
+-  m_taskCommit.slot() = std::tr1::bind(&DownloadFactory::receive_commit, this);
++  m_taskLoad.slot() = std::bind(&DownloadFactory::receive_load, this);
++  m_taskCommit.slot() = std::bind(&DownloadFactory::receive_commit, this);
+ 
+   // m_variables["connection_leech"] = rpc::call_command("protocol.connection.leech");
+   // m_variables["connection_seed"]  = rpc::call_command("protocol.connection.seed");
+@@ -158,8 +158,8 @@ DownloadFactory::receive_load() {
+     m_stream = new std::stringstream;
+     HttpQueue::iterator itr = m_manager->http_queue()->insert(m_uri, m_stream);
+ 
+-    (*itr)->signal_done().push_front(std::tr1::bind(&DownloadFactory::receive_loaded, this));
+-    (*itr)->signal_failed().push_front(std::tr1::bind(&DownloadFactory::receive_failed, this, std::tr1::placeholders::_1));
++    (*itr)->signal_done().push_front(std::bind(&DownloadFactory::receive_loaded, this));
++    (*itr)->signal_failed().push_front(std::bind(&DownloadFactory::receive_failed, this, std::placeholders::_1));
+ 
+     m_variables["tied_to_file"] = (int64_t)false;
+ 
+--- src/core/download_list.cc
++++ src/core/download_list.cc
+@@ -181,8 +181,8 @@ DownloadList::insert(Download* download) {
+   lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Inserting download.");
+ 
+   try {
+-    (*itr)->data()->slot_initial_hash()        = tr1::bind(&DownloadList::hash_done, this, download);
+-    (*itr)->data()->slot_download_done()       = tr1::bind(&DownloadList::received_finished, this, download);
++    (*itr)->data()->slot_initial_hash()        = std::bind(&DownloadList::hash_done, this, download);
++    (*itr)->data()->slot_download_done()       = std::bind(&DownloadList::received_finished, this, download);
+ 
+     // This needs to be separated into two different calls to ensure
+     // the download remains in the view.
+--- src/core/http_queue.cc
++++ src/core/http_queue.cc
+@@ -58,8 +58,8 @@ HttpQueue::insert(const std::string& url, std::iostream* s) {
+ 
+   iterator itr = Base::insert(end(), h.get());
+ 
+-  h->signal_done().push_back(std::tr1::bind(&HttpQueue::erase, this, itr));
+-  h->signal_failed().push_back(std::tr1::bind(&HttpQueue::erase, this, itr));
++  h->signal_done().push_back(std::bind(&HttpQueue::erase, this, itr));
++  h->signal_failed().push_back(std::bind(&HttpQueue::erase, this, itr));
+ 
+   (*itr)->start();
+ 
+--- src/core/manager.cc
++++ src/core/manager.cc
+@@ -135,7 +135,7 @@ Manager::get_throttle(const std::string& name) {
+ void
+ Manager::set_address_throttle(uint32_t begin, uint32_t end, torrent::ThrottlePair throttles) {
+   m_addressThrottles.set_merge(begin, end, throttles);
+-  torrent::connection_manager()->address_throttle() = tr1::bind(&core::Manager::get_address_throttle, control->core(), tr1::placeholders::_1);
++  torrent::connection_manager()->address_throttle() = std::bind(&core::Manager::get_address_throttle, control->core(), std::placeholders::_1);
+ }
+ 
+ torrent::ThrottlePair
+@@ -146,7 +146,7 @@ Manager::get_address_throttle(const sockaddr* addr) {
+ // Most of this should be possible to move out.
+ void
+ Manager::initialize_second() {
+-  torrent::Http::slot_factory() = std::tr1::bind(&CurlStack::new_object, m_httpStack);
++  torrent::Http::slot_factory() = std::bind(&CurlStack::new_object, m_httpStack);
+   m_httpQueue->slot_factory(sigc::mem_fun(m_httpStack, &CurlStack::new_object));
+ 
+   CurlStack::global_init();
+--- src/core/manager.h
++++ src/core/manager.h
+@@ -64,6 +64,11 @@ typedef std::map<std::string, torrent::ThrottlePair> ThrottleMap;
+ 
+ class View;
+ 
++static const int create_start    = 0x1;
++static const int create_tied     = 0x2;
++static const int create_quiet    = 0x4;
++static const int create_raw_data = 0x8;
++
+ class Manager {
+ public:
+   typedef DownloadList::iterator                    DListItr;
+@@ -118,11 +123,6 @@ public:
+ 
+   void                handshake_log(const sockaddr* sa, int msg, int err, const torrent::HashString* hash);
+ 
+-  static const int create_start    = 0x1;
+-  static const int create_tied     = 0x2;
+-  static const int create_quiet    = 0x4;
+-  static const int create_raw_data = 0x8;
+-
+   typedef std::vector<std::string> command_list_type;
+ 
+   // Temporary, find a better place for this.
+--- src/core/view.cc
++++ src/core/view.cc
+@@ -172,7 +172,7 @@ View::initialize(const std::string& name) {
+   m_focus = 0;
+ 
+   set_last_changed(rak::timer());
+-  m_delayChanged.slot() = std::tr1::bind(&signal_type::operator(), &m_signalChanged);
++  m_delayChanged.slot() = std::bind(&signal_type::operator(), &m_signalChanged);
+ }
+ 
+ void
+@@ -277,11 +277,11 @@ View::filter() {
+   // perhaps always clear them, thus not throwing anything.
+   if (!m_event_removed.is_empty())
+     std::for_each(changed.begin(), splitChanged,
+-                  tr1::bind(&rpc::call_object_d_nothrow, m_event_removed, tr1::placeholders::_1));
++                  std::bind(&rpc::call_object_d_nothrow, m_event_removed, std::placeholders::_1));
+ 
+   if (!m_event_added.is_empty())
+     std::for_each(changed.begin(), splitChanged,
+-                  tr1::bind(&rpc::call_object_d_nothrow, m_event_added, tr1::placeholders::_1));
++                  std::bind(&rpc::call_object_d_nothrow, m_event_added, std::placeholders::_1));
+ 
+   emit_changed();
+ }
+--- src/display/frame.cc
++++ src/display/frame.cc
+@@ -38,7 +38,7 @@
+ 
+ #include <algorithm>
+ #include <functional>
+-#include <tr1/functional>
++#include <functional>
+ #include <rak/algorithm.h>
+ #include <torrent/exceptions.h>
+ 
+@@ -367,9 +367,9 @@ Frame::balance_row(uint32_t x, uint32_t y, uint32_t width, uint32_t height) {
+   //
+   // Else if we're short, only give each what they require.
+   std::stable_sort(dynamicFrames, dynamicFrames + dynamicSize,
+-                   std::tr1::bind(std::greater<extent_type>(),
+-                                  std::tr1::bind(&dynamic_min_height, std::tr1::placeholders::_1),
+-                                  std::tr1::bind(&dynamic_min_height, std::tr1::placeholders::_2)));
++                   std::bind(std::greater<extent_type>(),
++                                  std::bind(&dynamic_min_height, std::placeholders::_1),
++                                  std::bind(&dynamic_min_height, std::placeholders::_2)));
+ 
+   bool retry;
+ 
+@@ -442,9 +442,9 @@ Frame::balance_column(uint32_t x, uint32_t y, uint32_t width, uint32_t height) {
+   //
+   // Else if we're short, only give each what they require.
+   std::stable_sort(dynamicFrames, dynamicFrames + dynamicSize,
+-                   std::tr1::bind(std::greater<extent_type>(),
+-                                  std::tr1::bind(&dynamic_min_width, std::tr1::placeholders::_1),
+-                                  std::tr1::bind(&dynamic_min_width, std::tr1::placeholders::_2)));
++                   std::bind(std::greater<extent_type>(),
++                                  std::bind(&dynamic_min_width, std::placeholders::_1),
++                                  std::bind(&dynamic_min_width, std::placeholders::_2)));
+ 
+   bool retry;
+ 
+--- src/display/manager.cc
++++ src/display/manager.cc
+@@ -50,7 +50,7 @@ namespace display {
+ Manager::Manager() :
+   m_forceRedraw(false) {
+ 
+-  m_taskUpdate.slot() = std::tr1::bind(&Manager::receive_update, this);
++  m_taskUpdate.slot() = std::bind(&Manager::receive_update, this);
+ }
+ 
+ Manager::~Manager() {
+--- src/display/window.cc
++++ src/display/window.cc
+@@ -59,7 +59,7 @@ Window::Window(Canvas* canvas, int flags, extent_type minWidth, extent_type minH
+   m_maxWidth(maxWidth),
+   m_maxHeight(maxHeight) {
+ 
+-  m_taskUpdate.slot() = std::tr1::bind(&Window::redraw, this);
++  m_taskUpdate.slot() = std::bind(&Window::redraw, this);
+ }
+ 
+ Window::~Window() {
+--- src/display/window_file_list.cc
++++ src/display/window_file_list.cc
+@@ -1,3 +1,4 @@
++#include <locale>
+ // rTorrent - BitTorrent client
+ // Copyright (C) 2005-2011, Jari Sundell
+ //
+--- src/display/window_log.cc
++++ src/display/window_log.cc
+@@ -50,11 +50,11 @@ WindowLog::WindowLog(torrent::log_buffer* l) :
+   Window(new Canvas, 0, 0, 0, extent_full, extent_static),
+   m_log(l) {
+ 
+-  m_taskUpdate.slot() = std::tr1::bind(&WindowLog::receive_update, this);
++  m_taskUpdate.slot() = std::bind(&WindowLog::receive_update, this);
+ 
+-  unsigned int signal_index = torrent::main_thread()->signal_bitfield()->add_signal(std::tr1::bind(&WindowLog::receive_update, this));
++  unsigned int signal_index = torrent::main_thread()->signal_bitfield()->add_signal(std::bind(&WindowLog::receive_update, this));
+ 
+-  m_log->lock_and_set_update_slot(std::tr1::bind(&torrent::thread_base::send_event_signal, torrent::main_thread(), signal_index, false));
++  m_log->lock_and_set_update_slot(std::bind(&torrent::thread_base::send_event_signal, torrent::main_thread(), signal_index, false));
+ }
+ 
+ WindowLog::~WindowLog() {
+--- src/main.cc
++++ src/main.cc
+@@ -209,11 +209,11 @@ main(int argc, char** argv) {
+     torrent::log_add_group_output(torrent::LOG_NOTICE, "important");
+     torrent::log_add_group_output(torrent::LOG_INFO, "complete");
+ 
+-    torrent::Poll::slot_create_poll() = std::tr1::bind(&core::create_poll);
++    torrent::Poll::slot_create_poll() = std::bind(&core::create_poll);
+ 
+     torrent::initialize();
+-    torrent::main_thread()->slot_do_work() = tr1::bind(&client_perform);
+-    torrent::main_thread()->slot_next_timeout() = tr1::bind(&client_next_timeout, control);
++    torrent::main_thread()->slot_do_work() = std::bind(&client_perform);
++    torrent::main_thread()->slot_next_timeout() = std::bind(&client_next_timeout, control);
+ 
+     worker_thread = new ThreadWorker();
+     worker_thread->init_thread();
+--- src/rpc/command.h
++++ src/rpc/command.h
+@@ -41,13 +41,12 @@
+ #include <limits>
+ #include <inttypes.h>
+ #include <torrent/object.h>
+-#include <tr1/functional>
++#include <functional>
+ 
+ #include <torrent/object.h>
+ #include <torrent/data/file_list_iterator.h>
+ 
+ // Move into config.h or something.
+-namespace tr1 { using namespace std::tr1; }
+ 
+ namespace core {
+   class Download;
+@@ -111,7 +110,7 @@ typedef rt_triple<int, void*, void*> target_type;
+ class command_base;
+ 
+ typedef const torrent::Object (*command_base_call_type)(command_base*, target_type, const torrent::Object&);
+-typedef tr1::function<torrent::Object (target_type, const torrent::Object&)> base_function;
++typedef std::function<torrent::Object (target_type, const torrent::Object&)> base_function;
+ 
+ template <typename tmpl> struct command_base_is_valid {};
+ template <command_base_call_type tmpl_func> struct command_base_is_type {};
+@@ -250,7 +249,7 @@ command_base::_call(command_base* cmd, target_type target, Args args) {
+ }
+ 
+ #define COMMAND_BASE_TEMPLATE_TYPE(func_type, func_parm)                \
+-  template <typename T, int proper = target_type_id<T>::proper_type> struct func_type { typedef tr1::function<func_parm> type; }; \
++  template <typename T, int proper = target_type_id<T>::proper_type> struct func_type { typedef std::function<func_parm> type; }; \
+                                                                         \
+   template <> struct command_base_is_valid<func_type<target_type>::type>                { static const int value = 1; }; \
+   template <> struct command_base_is_valid<func_type<core::Download*>::type>            { static const int value = 1; }; \
+--- src/rpc/command_scheduler.cc
++++ src/rpc/command_scheduler.cc
+@@ -71,7 +71,7 @@ CommandScheduler::insert(const std::string& key) {
+     delete *itr;
+ 
+   *itr = new CommandSchedulerItem(key);
+-  (*itr)->slot() = std::tr1::bind(&CommandScheduler::call_item, this, *itr);
++  (*itr)->slot() = std::bind(&CommandScheduler::call_item, this, *itr);
+ 
+   return itr;
+ }
+--- src/rpc/command_scheduler_item.h
++++ src/rpc/command_scheduler_item.h
+@@ -39,14 +39,14 @@
+ 
+ #include "globals.h"
+ 
+-#include <tr1/functional>
++#include <functional>
+ #include <torrent/object.h>
+ 
+ namespace rpc {
+ 
+ class CommandSchedulerItem {
+ public:
+-  typedef std::tr1::function<void ()> slot_void;
++  typedef std::function<void ()> slot_void;
+ 
+   CommandSchedulerItem(const std::string& key) : m_key(key), m_interval(0) {}
+   ~CommandSchedulerItem();
+--- src/rpc/exec_file.h
++++ src/rpc/exec_file.h
+@@ -41,15 +41,16 @@
+ 
+ namespace rpc {
+ 
++const unsigned int max_args    = 128;
++const unsigned int buffer_size = 4096;
++
++const int flag_expand_tilde = 0x1;
++const int flag_throw        = 0x2;
++const int flag_capture      = 0x4;
++const int flag_background   = 0x8;
++
+ class ExecFile {
+ public:
+-  static const unsigned int max_args    = 128;
+-  static const unsigned int buffer_size = 4096;
+-    
+-  static const int flag_expand_tilde = 0x1;
+-  static const int flag_throw        = 0x2;
+-  static const int flag_capture      = 0x4;
+-  static const int flag_background   = 0x8;
+ 
+   ExecFile() : m_logFd(-1) {}
+ 
+--- src/rpc/object_storage.cc
++++ src/rpc/object_storage.cc
+@@ -245,7 +245,7 @@ object_storage::rlookup_list(const std::string& cmd_key) {
+   
+   if (r_itr != m_rlookup.end())
+     std::transform(r_itr->second.begin(), r_itr->second.end(), std::back_inserter(result),
+-                   std::tr1::bind(&key_type::c_str, std::tr1::bind(rak::mem_ptr(&value_type::first), std::tr1::placeholders::_1)));
++                   std::bind(&key_type::c_str, std::bind(rak::mem_ptr(&value_type::first), std::placeholders::_1)));
+ 
+   return result;
+ }
+--- src/rpc/object_storage.h
++++ src/rpc/object_storage.h
+@@ -42,7 +42,7 @@
+ #define RTORRENT_RPC_OBJECT_STORAGE_H
+ 
+ #include <cstring>
+-#include <tr1/unordered_map>
++#include <unordered_map>
+ #include <torrent/object.h>
+ 
+ #include "rak/unordered_vector.h"
+@@ -56,7 +56,22 @@ struct object_storage_node {
+   char            flags;
+ };
+ 
+-typedef std::tr1::unordered_map<fixed_key_type<64>, object_storage_node, hash_fixed_key_type> object_storage_base_type;
++typedef std::unordered_map<fixed_key_type<64>, object_storage_node, hash_fixed_key_type> object_storage_base_type;
++
++static const unsigned int flag_generic_type  = 0x1;
++static const unsigned int flag_bool_type     = 0x2;
++static const unsigned int flag_value_type    = 0x3;
++static const unsigned int flag_string_type   = 0x4;
++static const unsigned int flag_list_type     = 0x5;
++static const unsigned int flag_function_type = 0x6;
++static const unsigned int flag_multi_type    = 0x7;
++
++static const unsigned int mask_type          = 0xf;
++
++static const unsigned int flag_constant      = 0x10;
++static const unsigned int flag_static        = 0x20;
++static const unsigned int flag_private       = 0x40;
++static const unsigned int flag_rlookup       = 0x80;
+ 
+ class object_storage : private object_storage_base_type {
+ public:
+@@ -90,21 +105,6 @@ public:
+   using base_type::find;
+   using base_type::erase;
+   
+-  static const unsigned int flag_generic_type  = 0x1;
+-  static const unsigned int flag_bool_type     = 0x2;
+-  static const unsigned int flag_value_type    = 0x3;
+-  static const unsigned int flag_string_type   = 0x4;
+-  static const unsigned int flag_list_type     = 0x5;
+-  static const unsigned int flag_function_type = 0x6;
+-  static const unsigned int flag_multi_type    = 0x7;
+-
+-  static const unsigned int mask_type          = 0xf;
+-
+-  static const unsigned int flag_constant      = 0x10;
+-  static const unsigned int flag_static        = 0x20;
+-  static const unsigned int flag_private       = 0x40;
+-  static const unsigned int flag_rlookup       = 0x80;
+-
+   static const size_t key_size = key_type::max_size;
+ 
+   local_iterator find_local(const torrent::raw_string& key);
+--- src/rpc/xmlrpc.h
++++ src/rpc/xmlrpc.h
+@@ -37,7 +37,7 @@
+ #ifndef RTORRENT_RPC_XMLRPC_H
+ #define RTORRENT_RPC_XMLRPC_H
+ 
+-#include <tr1/functional>
++#include <functional>
+ #include <torrent/hash_string.h>
+ 
+ namespace core {
+@@ -54,11 +54,11 @@ namespace rpc {
+ 
+ class XmlRpc {
+ public:
+-  typedef std::tr1::function<core::Download* (const char*)>                 slot_download;
+-  typedef std::tr1::function<torrent::File* (core::Download*, uint32_t)>    slot_file;
+-  typedef std::tr1::function<torrent::Tracker* (core::Download*, uint32_t)> slot_tracker;
+-  typedef std::tr1::function<torrent::Peer* (core::Download*, const torrent::HashString&)> slot_peer;
+-  typedef std::tr1::function<bool (const char*, uint32_t)>                  slot_write;
++  typedef std::function<core::Download* (const char*)>                 slot_download;
++  typedef std::function<torrent::File* (core::Download*, uint32_t)>    slot_file;
++  typedef std::function<torrent::Tracker* (core::Download*, uint32_t)> slot_tracker;
++  typedef std::function<torrent::Peer* (core::Download*, const torrent::HashString&)> slot_peer;
++  typedef std::function<bool (const char*, uint32_t)>                  slot_write;
+ 
+   static const int dialect_generic = 0;
+   static const int dialect_i8      = 1;
+--- src/signal_handler.cc
++++ src/signal_handler.cc
+@@ -1,3 +1,4 @@
++#include <string>
+ // rTorrent - BitTorrent client
+ // Copyright (C) 2005-2011, Jari Sundell
+ //
+--- src/thread_base.cc
++++ src/thread_base.cc
+@@ -109,7 +109,7 @@ public:
+ void throw_shutdown_exception() { throw torrent::shutdown_exception(); }
+ 
+ ThreadBase::ThreadBase() {
+-  m_taskShutdown.slot() = std::tr1::bind(&throw_shutdown_exception);
++  m_taskShutdown.slot() = std::bind(&throw_shutdown_exception);
+ 
+   m_threadQueue = new thread_queue_hack;
+ }
+--- src/ui/download_list.cc
++++ src/ui/download_list.cc
+@@ -304,7 +304,7 @@ DownloadList::receive_exit_input(Input type) {
+       if (input->str().empty())
+         break;
+ 
+-      control->core()->try_create_download_expand(input->str(), type == INPUT_LOAD_DEFAULT ? core::Manager::create_start : 0);
++      control->core()->try_create_download_expand(input->str(), type == INPUT_LOAD_DEFAULT ? core::create_start : 0);
+       break;
+ 
+     case INPUT_CHANGE_DIRECTORY:
+--- src/ui/element_log_complete.cc
++++ src/ui/element_log_complete.cc
+@@ -54,9 +54,9 @@ ElementLogComplete::ElementLogComplete(torrent::log_buffer* l) :
+   m_window(NULL),
+   m_log(l) {
+ 
+-  unsigned int signal_index = torrent::main_thread()->signal_bitfield()->add_signal(std::tr1::bind(&ElementLogComplete::received_update, this));
++  unsigned int signal_index = torrent::main_thread()->signal_bitfield()->add_signal(std::bind(&ElementLogComplete::received_update, this));
+ 
+-  m_log->lock_and_set_update_slot(std::tr1::bind(&torrent::thread_base::send_event_signal, torrent::main_thread(), signal_index, false));
++  m_log->lock_and_set_update_slot(std::bind(&torrent::thread_base::send_event_signal, torrent::main_thread(), signal_index, false));
+ }
+ 
+ void
+--- src/ui/element_peer_list.cc
++++ src/ui/element_peer_list.cc
+@@ -68,9 +68,9 @@ ElementPeerList::ElementPeerList(core::Download* d) :
+   torrent::ConnectionList* connection_list = m_download->download()->connection_list();
+ 
+   m_peer_connected = connection_list->signal_connected().insert(connection_list->signal_connected().end(),
+-                                                                tr1::bind(&ElementPeerList::receive_peer_connected, this, tr1::placeholders::_1));
++                                                                std::bind(&ElementPeerList::receive_peer_connected, this, std::placeholders::_1));
+   m_peer_disconnected = connection_list->signal_disconnected().insert(connection_list->signal_disconnected().end(),
+-                                                                      tr1::bind(&ElementPeerList::receive_peer_disconnected, this, tr1::placeholders::_1));
++                                                                      std::bind(&ElementPeerList::receive_peer_disconnected, this, std::placeholders::_1));
+ 
+   m_windowList  = new display::WindowPeerList(m_download, &m_list, &m_listItr);
+   m_elementInfo = create_info();
+--- test/rpc/command_map_test.cc
++++ test/rpc/command_map_test.cc
+@@ -21,7 +21,7 @@ torrent::Object cmd_test_any_string(__UNUSED rpc::target_type target, const std:
+ void
+ CommandMapTest::test_basics() {
+   CMD2_ANY("test_a", &cmd_test_map_a);
+-  CMD2_ANY("test_b", tr1::bind(&cmd_test_map_b, tr1::placeholders::_1, tr1::placeholders::_2, (uint64_t)2));
++  CMD2_ANY("test_b", std::bind(&cmd_test_map_b, std::placeholders::_1, std::placeholders::_2, (uint64_t)2));
+   CMD2_ANY_STRING("any_string", &cmd_test_any_string);
+ 
+   CPPUNIT_ASSERT(m_map.call_command("test_a", (int64_t)1).as_value() == 1);
+--- test/rpc/command_slot_test.cc
++++ test/rpc/command_slot_test.cc
+@@ -25,7 +25,7 @@ CommandSlotTest::test_basics() {
+ //   test_any.set_function<rpc::any_function>(&cmd_test_a);
+ //   CPPUNIT_ASSERT(rpc::command_base_call_any(&test_any, rpc::make_target(), (int64_t)1).as_value() == 1);
+ 
+-//   test_any.set_function<rpc::any_function>(tr1::bind(&cmd_test_b, tr1::placeholders::_1, tr1::placeholders::_2, (uint64_t)2));
++//   test_any.set_function<rpc::any_function>(std::bind(&cmd_test_b, std::placeholders::_1, std::placeholders::_2, (uint64_t)2));
+ //   CPPUNIT_ASSERT(rpc::command_base_call_any(&test_any, rpc::make_target(), (int64_t)1).as_value() == 2);
+ 
+ //   test_any.set_function<rpc::any_list_function>(&cmd_test_list);

Property changes on: files/extra-patch-fix-clang-build.diff
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131230160321.6918D2A15>