Explicitly specify std::placeholders namespace for all bind placeholders

Apparently, even on Boost 1.73 without Boost placeholders specialized as is_placeholder, they were somehow
getting used in the global namespace. Would explain all the "Boost placeholders in the global namespace is
deprecated" warnings I was getting after 23d1db043f.

When testing with BOOST_BIND_NO_PLACEHOLDERS, even though I had `using namespace std::placeholders` in utils/functional.hpp,
compilation still failed in places. This confirms even more that Boost global placeholders were being used. Honestly,
it was simplest just to specify std::placeholders for everything. This also means we can remove the hack in utils/functional.hpp
designed to allow Boost placeholders to work with `std::bind`.
This commit is contained in:
Charles Dang 2020-12-04 15:28:15 +11:00
parent 472fba4e76
commit 30c7a747ab
63 changed files with 266 additions and 266 deletions

View file

@ -70,16 +70,16 @@ void ai_composite::on_create()
}
std::function<void(std::vector<engine_ptr>&, const config&)> factory_engines =
std::bind(&ai::ai_composite::create_engine,*this,_1,_2);
std::bind(&ai::ai_composite::create_engine, *this, std::placeholders::_1, std::placeholders::_2);
std::function<void(std::vector<goal_ptr>&, const config&)> factory_goals =
std::bind(&ai::ai_composite::create_goal,*this,_1,_2);
std::bind(&ai::ai_composite::create_goal, *this, std::placeholders::_1, std::placeholders::_2);
std::function<void(std::vector<stage_ptr>&, const config&)> factory_stages =
std::bind(&ai::ai_composite::create_stage,*this,_1,_2);
std::bind(&ai::ai_composite::create_stage, *this, std::placeholders::_1, std::placeholders::_2);
std::function<void(std::map<std::string,aspect_ptr>&, const config&, std::string)> factory_aspects =
std::bind(&ai::ai_composite::replace_aspect,*this,_1,_2,_3);
std::bind(&ai::ai_composite::replace_aspect,*this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3);
register_vector_property(property_handlers(),"engine",get_engines(), factory_engines);
register_vector_property(property_handlers(),"goal",get_goals(), factory_goals);

View file

@ -265,7 +265,7 @@ public:
}
std::function<void(typesafe_aspect_vector<T>&, const config&)> factory_facets =
std::bind(&ai::composite_aspect<T>::create_facet,*this,_1,_2);
std::bind(&ai::composite_aspect<T>::create_facet, *this, std::placeholders::_1, std::placeholders::_2);
register_facets_property(this->property_handlers(),"facet",facets_,default_, factory_facets);

View file

@ -1834,9 +1834,9 @@ recruitment_aspect::recruitment_aspect(readonly_context &context, const config &
create_limit(limits_, lim);
}
std::function<void(std::vector<std::shared_ptr<recruit_job>>&, const config&)> factory_jobs =
std::bind(&recruitment_aspect::create_job,*this,_1,_2);
std::bind(&recruitment_aspect::create_job, *this, std::placeholders::_1, std::placeholders::_2);
std::function<void(std::vector<std::shared_ptr<recruit_limit>>&, const config&)> factory_limits =
std::bind(&recruitment_aspect::create_limit,*this,_1,_2);
std::bind(&recruitment_aspect::create_limit, *this, std::placeholders::_1, std::placeholders::_2);
register_vector_property(property_handlers(), "recruit", jobs_, factory_jobs);
register_vector_property(property_handlers(), "limit", limits_, factory_limits);
}

View file

@ -416,7 +416,7 @@ bool config_attribute_value::equals(const std::string& str) const
return *this == v;
// if c["a"] = "1" then this solution would have resulted in c["a"] == "1" being false
// because a["a"] is '1' and not '"1"'.
// return boost::apply_visitor(std::bind( equality_visitor(), _1, std::cref(str) ), value_);
// return boost::apply_visitor(std::bind( equality_visitor(), std::placeholders::_1, std::cref(str) ), value_);
// that's why we don't use it.
}

View file

@ -96,7 +96,7 @@ void editor_controller::init_gui()
{
gui_->change_display_context(&get_current_map_context());
preferences::set_preference_display_settings();
gui_->add_redraw_observer(std::bind(&editor_controller::display_redraw_callback, this, _1));
gui_->add_redraw_observer(std::bind(&editor_controller::display_redraw_callback, this, std::placeholders::_1));
floating_label_manager_.reset(new font::floating_label_context());
gui().set_draw_coordinates(preferences::editor::draw_hex_coordinates());
gui().set_draw_terrain_codes(preferences::editor::draw_terrain_codes());

View file

@ -578,7 +578,7 @@ private:
callback_change_(*widget);
}
connect_signal_notify_modified(*widget, std::bind(callback_change_, _1));
connect_signal_notify_modified(*widget, std::bind(callback_change_, std::placeholders::_1));
}
}
}

View file

@ -82,35 +82,35 @@ mouse_motion::mouse_motion(widget& owner,
owner.connect_signal<event::SDL_MOUSE_MOTION>(
std::bind(&mouse_motion::signal_handler_sdl_mouse_motion,
this,
_2,
_3,
_5),
std::placeholders::_2,
std::placeholders::_3,
std::placeholders::_5),
queue_position);
owner.connect_signal<event::SDL_TOUCH_MOTION>(
std::bind(&mouse_motion::signal_handler_sdl_touch_motion,
this,
_2,
_3,
_5,
_6),
std::placeholders::_2,
std::placeholders::_3,
std::placeholders::_5,
std::placeholders::_6),
queue_position);
owner_.connect_signal<event::SDL_WHEEL_UP>(std::bind(
&mouse_motion::signal_handler_sdl_wheel, this, _2, _3, _5));
&mouse_motion::signal_handler_sdl_wheel, this, std::placeholders::_2, std::placeholders::_3, std::placeholders::_5));
owner_.connect_signal<event::SDL_WHEEL_DOWN>(std::bind(
&mouse_motion::signal_handler_sdl_wheel, this, _2, _3, _5));
&mouse_motion::signal_handler_sdl_wheel, this, std::placeholders::_2, std::placeholders::_3, std::placeholders::_5));
owner_.connect_signal<event::SDL_WHEEL_LEFT>(std::bind(
&mouse_motion::signal_handler_sdl_wheel, this, _2, _3, _5));
&mouse_motion::signal_handler_sdl_wheel, this, std::placeholders::_2, std::placeholders::_3, std::placeholders::_5));
owner_.connect_signal<event::SDL_WHEEL_RIGHT>(std::bind(
&mouse_motion::signal_handler_sdl_wheel, this, _2, _3, _5));
&mouse_motion::signal_handler_sdl_wheel, this, std::placeholders::_2, std::placeholders::_3, std::placeholders::_5));
owner.connect_signal<event::SHOW_HELPTIP>(
std::bind(&mouse_motion::signal_handler_show_helptip,
this,
_2,
_3,
_5),
std::placeholders::_2,
std::placeholders::_3,
std::placeholders::_5),
queue_position);
}
@ -379,16 +379,16 @@ mouse_button::mouse_button(const mouse_button_event_types& events, widget& owner
owner_.connect_signal<event::SDL_LEFT_BUTTON_DOWN>(
std::bind(&mouse_button::signal_handler_sdl_button_down,
this,
_2,
_3,
_5),
std::placeholders::_2,
std::placeholders::_3,
std::placeholders::_5),
queue_position);
owner_.connect_signal<event::SDL_LEFT_BUTTON_UP>(
std::bind(&mouse_button::signal_handler_sdl_button_up,
this,
_2,
_3,
_5),
std::placeholders::_2,
std::placeholders::_3,
std::placeholders::_5),
queue_position);
break;
}
@ -396,16 +396,16 @@ mouse_button::mouse_button(const mouse_button_event_types& events, widget& owner
owner_.connect_signal<event::SDL_MIDDLE_BUTTON_DOWN>(
std::bind(&mouse_button::signal_handler_sdl_button_down,
this,
_2,
_3,
_5),
std::placeholders::_2,
std::placeholders::_3,
std::placeholders::_5),
queue_position);
owner_.connect_signal<event::SDL_MIDDLE_BUTTON_UP>(
std::bind(&mouse_button::signal_handler_sdl_button_up,
this,
_2,
_3,
_5),
std::placeholders::_2,
std::placeholders::_3,
std::placeholders::_5),
queue_position);
break;
}
@ -413,16 +413,16 @@ mouse_button::mouse_button(const mouse_button_event_types& events, widget& owner
owner_.connect_signal<event::SDL_RIGHT_BUTTON_DOWN>(
std::bind(&mouse_button::signal_handler_sdl_button_down,
this,
_2,
_3,
_5),
std::placeholders::_2,
std::placeholders::_3,
std::placeholders::_5),
queue_position);
owner_.connect_signal<event::SDL_RIGHT_BUTTON_UP>(
std::bind(&mouse_button::signal_handler_sdl_button_up,
this,
_2,
_3,
_5),
std::placeholders::_2,
std::placeholders::_3,
std::placeholders::_5),
queue_position);
break;
}
@ -631,16 +631,16 @@ distributor::distributor(widget& owner,
}
owner_.connect_signal<event::SDL_KEY_DOWN>(std::bind(
&distributor::signal_handler_sdl_key_down, this, _5, _6, _7));
&distributor::signal_handler_sdl_key_down, this, std::placeholders::_5, std::placeholders::_6, std::placeholders::_7));
owner_.connect_signal<event::SDL_TEXT_INPUT>(std::bind(
&distributor::signal_handler_sdl_text_input, this, _5, _6, _7));
&distributor::signal_handler_sdl_text_input, this, std::placeholders::_5, std::placeholders::_6, std::placeholders::_7));
owner_.connect_signal<event::SDL_TEXT_EDITING>(std::bind(
&distributor::signal_handler_sdl_text_editing, this, _5, _6, _7));
&distributor::signal_handler_sdl_text_editing, this, std::placeholders::_5, std::placeholders::_6, std::placeholders::_7));
owner_.connect_signal<event::NOTIFY_REMOVAL>(std::bind(
&distributor::signal_handler_notify_removal, this, _1, _2));
&distributor::signal_handler_notify_removal, this, std::placeholders::_1, std::placeholders::_2));
initialize_state();
}
@ -648,16 +648,16 @@ distributor::distributor(widget& owner,
distributor::~distributor()
{
owner_.disconnect_signal<event::SDL_KEY_DOWN>(std::bind(
&distributor::signal_handler_sdl_key_down, this, _5, _6, _7));
&distributor::signal_handler_sdl_key_down, this, std::placeholders::_5, std::placeholders::_6, std::placeholders::_7));
owner_.disconnect_signal<event::SDL_TEXT_INPUT>(std::bind(
&distributor::signal_handler_sdl_text_input, this, _5, _6, _7));
&distributor::signal_handler_sdl_text_input, this, std::placeholders::_5, std::placeholders::_6, std::placeholders::_7));
owner_.disconnect_signal<event::SDL_TEXT_EDITING>(std::bind(
&distributor::signal_handler_sdl_text_editing, this, _5, _6, _7));
&distributor::signal_handler_sdl_text_editing, this, std::placeholders::_5, std::placeholders::_6, std::placeholders::_7));
owner_.disconnect_signal<event::NOTIFY_REMOVAL>(std::bind(
&distributor::signal_handler_notify_removal, this, _1, _2));
&distributor::signal_handler_notify_removal, this, std::placeholders::_1, std::placeholders::_2));
}
void distributor::initialize_state()

View file

@ -248,7 +248,7 @@ void campaign_selection::pre_show(window& window)
{
text_box* filter = find_widget<text_box>(&window, "filter_box", false, true);
filter->set_text_changed_callback(
std::bind(&campaign_selection::filter_text_changed, this, _2));
std::bind(&campaign_selection::filter_text_changed, this, std::placeholders::_2));
/***** Setup campaign tree. *****/
tree_view& tree = find_widget<tree_view>(&window, "campaign_tree", false);

View file

@ -227,10 +227,10 @@ void drop_down_menu::pre_show(window& window)
// Dismiss on clicking outside the window.
window.connect_signal<event::SDL_LEFT_BUTTON_UP>(
std::bind(&drop_down_menu::mouse_up_callback, this, _3, _4, _5), event::dispatcher::front_child);
std::bind(&drop_down_menu::mouse_up_callback, this, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5), event::dispatcher::front_child);
window.connect_signal<event::SDL_RIGHT_BUTTON_UP>(
std::bind(&drop_down_menu::mouse_up_callback, this, _3, _4, _5), event::dispatcher::front_child);
std::bind(&drop_down_menu::mouse_up_callback, this, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5), event::dispatcher::front_child);
window.connect_signal<event::SDL_LEFT_BUTTON_DOWN>(
std::bind(&drop_down_menu::mouse_down_callback, this), event::dispatcher::front_child);

View file

@ -93,7 +93,7 @@ void editor_edit_label::pre_show(window& win)
void editor_edit_label::register_color_component(std::string widget_id, uint8_t color_t::* component) {
register_integer(widget_id, true,
std::bind(&editor_edit_label::load_color_component, this, component),
std::bind(&editor_edit_label::save_color_component, this, component, _1));
std::bind(&editor_edit_label::save_color_component, this, component, std::placeholders::_1));
}
int editor_edit_label::load_color_component(uint8_t color_t::* component) {

View file

@ -57,7 +57,7 @@ void end_credits::pre_show(window& window)
connect_signal_on_draw(window, std::bind(&end_credits::timer_callback, this));
connect_signal_pre_key_press(window, std::bind(&end_credits::key_press_callback, this, _5));
connect_signal_pre_key_press(window, std::bind(&end_credits::key_press_callback, this, std::placeholders::_5));
std::stringstream ss;
std::stringstream focus_ss;

View file

@ -259,7 +259,7 @@ void file_dialog::pre_show(window& window)
window.keyboard_capture(find_widget<text_box>(&window, "filename", false, true));
window.add_to_keyboard_chain(&filelist);
window.set_exit_hook(std::bind(&file_dialog::on_exit, this, _1));
window.set_exit_hook(std::bind(&file_dialog::on_exit, this, std::placeholders::_1));
}
bool file_dialog::on_exit(window& window)

View file

@ -119,13 +119,13 @@ game_load::game_load(const game_config_view& cache_config, savegame::load_game_m
void game_load::pre_show(window& window)
{
// Allow deleting saves with the Delete key.
connect_signal_pre_key_press(window, std::bind(&game_load::key_press_callback, this, _5));
connect_signal_pre_key_press(window, std::bind(&game_load::key_press_callback, this, std::placeholders::_5));
find_widget<minimap>(&window, "minimap", false).set_config(&cache_config_);
text_box* filter = find_widget<text_box>(&window, "txtFilter", false, true);
filter->set_text_changed_callback(std::bind(&game_load::filter_text_changed, this, _2));
filter->set_text_changed_callback(std::bind(&game_load::filter_text_changed, this, std::placeholders::_2));
listbox& list = find_widget<listbox>(&window, "savegame_list", false);

View file

@ -380,14 +380,14 @@ public:
void set_node_callback(const std::vector<int>& node_path, void (C::* fcn)(tree_view_node&))
{
C& sub_controller = *get_controller<C>();
callbacks.emplace(node_path, std::bind(fcn, sub_controller, _1));
callbacks.emplace(node_path, std::bind(fcn, sub_controller, std::placeholders::_1));
}
template<typename C, typename T>
void set_node_callback(const std::vector<int>& node_path, void (C::* fcn)(tree_view_node&, T), T param)
{
C& sub_controller = *get_controller<C>();
callbacks.emplace(node_path, std::bind(fcn, sub_controller, _1, param));
callbacks.emplace(node_path, std::bind(fcn, sub_controller, std::placeholders::_1, param));
}
void bind(window& window)
@ -399,7 +399,7 @@ public:
auto right_button = find_widget<button>(&window, "page_right", false, true);
connect_signal_notify_modified(*stuff_list,
std::bind(&gamestate_inspector::controller::handle_stuff_list_item_clicked, this, _1));
std::bind(&gamestate_inspector::controller::handle_stuff_list_item_clicked, this, std::placeholders::_1));
connect_signal_mouse_left_click(
*copy_button,

View file

@ -37,7 +37,7 @@ hotkey_bind::hotkey_bind(const std::string& hotkey_id)
void hotkey_bind::pre_show(window& window)
{
window.connect_signal<event::SDL_RAW_EVENT>(
std::bind(&hotkey_bind::sdl_event_callback, this, _5),
std::bind(&hotkey_bind::sdl_event_callback, this, std::placeholders::_5),
event::dispatcher::front_child);
}

View file

@ -113,7 +113,7 @@ void label_settings::pre_show(window& window)
toggle_button& status = find_widget<toggle_button>(grid, "cat_status", false);
status.set_value(visible);
connect_signal_notify_modified(status, std::bind(&label_settings::toggle_category, this, _1, category));
connect_signal_notify_modified(status, std::bind(&label_settings::toggle_category, this, std::placeholders::_1, category));
if(category.substr(0, 5) == "side:") {
label& cat_name = find_widget<label>(grid, "cat_name", false);

View file

@ -90,7 +90,7 @@ void log_settings::pre_show(window& window)
}
text_box* filter = find_widget<text_box>(&window, "filter_box", false, true);
filter->set_text_changed_callback(std::bind(&log_settings::filter_text_changed, this, _2));
filter->set_text_changed_callback(std::bind(&log_settings::filter_text_changed, this, std::placeholders::_2));
window.keyboard_capture(filter);
window.add_to_keyboard_chain(&logger_box);

View file

@ -467,9 +467,9 @@ void lua_interpreter::controller::bind(window& window)
*text_entry,
std::bind(&lua_interpreter::controller::input_keypress_callback,
this,
_3,
_4,
_5,
std::placeholders::_3,
std::placeholders::_4,
std::placeholders::_5,
std::ref(window)));
copy_button = find_widget<button>(&window, "copy", false, true);

View file

@ -741,7 +741,7 @@ void mp_lobby::pre_show(window& window)
window.set_enter_disabled(true);
// Exit hook to add a confirmation when quitting the Lobby.
window.set_exit_hook(std::bind(&mp_lobby::exit_hook, this, _1));
window.set_exit_hook(std::bind(&mp_lobby::exit_hook, this, std::placeholders::_1));
chatbox_ = find_widget<chatbox>(&window, "chat", false, true);
@ -806,7 +806,7 @@ void mp_lobby::pre_show(window& window)
connect_signal_pre_key_press(
*filter_text_,
std::bind(&mp_lobby::game_filter_keypress_callback, this, _5));
std::bind(&mp_lobby::game_filter_keypress_callback, this, std::placeholders::_5));
chatbox_->room_window_open(N_("lobby"), true, false);
chatbox_->active_window_changed();

View file

@ -464,7 +464,7 @@ void mp_join_game::generate_side_list()
handled = halt = true;
};
connect_signal_mouse_left_click(*select_leader_button, std::bind(handler, _3, _4));
connect_signal_mouse_left_click(*select_leader_button, std::bind(handler, std::placeholders::_3, std::placeholders::_4));
} else {
select_leader_button->set_visible(widget::visibility::hidden);
}

View file

@ -328,8 +328,8 @@ void preferences_dialog::initialize_sound_option_group(const std::string& id_suf
// the callback the setter callback is duplicated in the on-change callback. The field
// class could possibly use some reworking to make this less redundant, but for now it
// works well enough.
register_bool(toggle_widget_id, true, toggle_getter, std::bind(toggle_setter, _1),
std::bind(sound_toggle_on_change<toggle_setter>, std::ref(window), volume_widget_id, _1), true);
register_bool(toggle_widget_id, true, toggle_getter, std::bind(toggle_setter, std::placeholders::_1),
std::bind(sound_toggle_on_change<toggle_setter>, std::ref(window), volume_widget_id, std::placeholders::_1), true);
// Set up the volume slider. integer_field doesn't have a callback-on-changed mechanism.
// To add one would either mean adding it to the base field class or make it a proper
@ -338,7 +338,7 @@ void preferences_dialog::initialize_sound_option_group(const std::string& id_suf
// Callback to actually immediately apply the volume effect.
connect_signal_notify_modified(find_widget<slider>(&window, volume_widget_id, false),
std::bind(volume_setter_on_change<vol_setter>, _1));
std::bind(volume_setter_on_change<vol_setter>, std::placeholders::_1));
}
/**
@ -700,7 +700,7 @@ void preferences_dialog::post_build(window& window)
// We need to bind a lambda here since preferences::set is overloaded.
// A lambda alone would be more verbose because it'd need to specify all the parameters.
connect_signal_notify_modified(menu,
std::bind([=](widget& w) { set(pref_name, option_ids[dynamic_cast<menu_button&>(w).get_value()]); }, _1));
std::bind([=](widget& w) { set(pref_name, option_ids[dynamic_cast<menu_button&>(w).get_value()]); }, std::placeholders::_1));
gui2::bind_status_label<menu_button>(main_grid, "setter", [](menu_button& m)->std::string {
return m.get_value_string();

View file

@ -85,7 +85,7 @@ void story_viewer::pre_show(window& window)
window.set_enter_disabled(true);
// Special callback handle key presses
connect_signal_pre_key_press(window, std::bind(&story_viewer::key_press_callback, this, _5));
connect_signal_pre_key_press(window, std::bind(&story_viewer::key_press_callback, this, std::placeholders::_5));
connect_signal_mouse_left_click(find_widget<button>(&window, "next", false),
std::bind(&story_viewer::nav_button_callback, this, DIR_FORWARD));

View file

@ -214,7 +214,7 @@ void title_screen::pre_show(window& win)
#ifdef DEBUG_TOOLTIP
win.connect_signal<event::SDL_MOUSE_MOTION>(
std::bind(debug_tooltip, std::ref(win), _3, _5),
std::bind(debug_tooltip, std::ref(win), std::placeholders::_3, std::placeholders::_5),
event::dispatcher::front_child);
#endif

View file

@ -110,7 +110,7 @@ void unit_create::pre_show(window& window)
= find_widget<text_box>(&window, "filter_box", false, true);
filter->set_text_changed_callback(
std::bind(&unit_create::filter_text_changed, this, _2));
std::bind(&unit_create::filter_text_changed, this, std::placeholders::_2));
window.keyboard_capture(filter);
window.add_to_keyboard_chain(&list);

View file

@ -167,7 +167,7 @@ void unit_recall::pre_show(window& window)
= find_widget<text_box>(&window, "filter_box", false, true);
filter->set_text_changed_callback(
std::bind(&unit_recall::filter_text_changed, this, _2));
std::bind(&unit_recall::filter_text_changed, this, std::placeholders::_2));
listbox& list = find_widget<listbox>(&window, "recall_list", false);

View file

@ -110,7 +110,7 @@ void unit_recruit::pre_show(window& window)
{
text_box* filter = find_widget<text_box>(&window, "filter_box", false, true);
filter->set_text_changed_callback(
std::bind(&unit_recruit::filter_text_changed, this, _2));
std::bind(&unit_recruit::filter_text_changed, this, std::placeholders::_2));
listbox& list = find_widget<listbox>(&window, "recruit_list", false);

View file

@ -259,7 +259,7 @@ void addon_list::set_addons(const addons_list& addons)
if(publish_function_ != nullptr) {
connect_signal_mouse_left_click(publish_button,
std::bind(&addon_list::addon_action_wrapper, this, publish_function_, std::ref(addon), _3, _4));
std::bind(&addon_list::addon_action_wrapper, this, publish_function_, std::ref(addon), std::placeholders::_3, std::placeholders::_4));
install_button.set_tooltip(_("Publish add-on"));
}
@ -270,7 +270,7 @@ void addon_list::set_addons(const addons_list& addons)
if(update_function_ != nullptr) {
connect_signal_mouse_left_click(update_button,
std::bind(&addon_list::addon_action_wrapper, this, update_function_, std::ref(addon), _3, _4));
std::bind(&addon_list::addon_action_wrapper, this, update_function_, std::ref(addon), std::placeholders::_3, std::placeholders::_4));
}
} else {
install_update_stack.select_layer(CONTROL_STACK_LAYER_INSTALL);
@ -279,7 +279,7 @@ void addon_list::set_addons(const addons_list& addons)
if(install_function_ != nullptr) {
connect_signal_mouse_left_click(install_button,
std::bind(&addon_list::addon_action_wrapper, this, install_function_, std::ref(addon), _3, _4));
std::bind(&addon_list::addon_action_wrapper, this, install_function_, std::ref(addon), std::placeholders::_3, std::placeholders::_4));
}
}
@ -290,7 +290,7 @@ void addon_list::set_addons(const addons_list& addons)
if(!is_local && delete_function_ != nullptr) {
connect_signal_mouse_left_click(uninstall_button,
std::bind(&addon_list::addon_action_wrapper, this, delete_function_, std::ref(addon), _3, _4));
std::bind(&addon_list::addon_action_wrapper, this, delete_function_, std::ref(addon), std::placeholders::_3, std::placeholders::_4));
uninstall_button.set_tooltip(_("Delete add-on from server"));
}
@ -300,7 +300,7 @@ void addon_list::set_addons(const addons_list& addons)
if(is_installed && uninstall_function_ != nullptr) {
connect_signal_mouse_left_click(uninstall_button,
std::bind(&addon_list::addon_action_wrapper, this, uninstall_function_, std::ref(addon), _3, _4));
std::bind(&addon_list::addon_action_wrapper, this, uninstall_function_, std::ref(addon), std::placeholders::_3, std::placeholders::_4));
}
}

View file

@ -47,16 +47,16 @@ button::button(const implementation::builder_button& builder)
, retval_(retval::NONE)
{
connect_signal<event::MOUSE_ENTER>(
std::bind(&button::signal_handler_mouse_enter, this, _2, _3));
std::bind(&button::signal_handler_mouse_enter, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::MOUSE_LEAVE>(
std::bind(&button::signal_handler_mouse_leave, this, _2, _3));
std::bind(&button::signal_handler_mouse_leave, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::LEFT_BUTTON_DOWN>(std::bind(
&button::signal_handler_left_button_down, this, _2, _3));
&button::signal_handler_left_button_down, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::LEFT_BUTTON_UP>(
std::bind(&button::signal_handler_left_button_up, this, _2, _3));
std::bind(&button::signal_handler_left_button_up, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::LEFT_BUTTON_CLICK>(std::bind(
&button::signal_handler_left_button_click, this, _2, _3));
&button::signal_handler_left_button_click, this, std::placeholders::_2, std::placeholders::_3));
}
void button::set_active(const bool active)

View file

@ -72,7 +72,7 @@ chatbox::chatbox(const implementation::builder_chatbox& builder)
// loss itself when applicable. Nothing else happens in the interim while
// keyboard_focus_ equals `this` to warrent cleanup.
connect_signal<event::RECEIVE_KEYBOARD_FOCUS>(
std::bind(&chatbox::signal_handler_receive_keyboard_focus, this, _2));
std::bind(&chatbox::signal_handler_receive_keyboard_focus, this, std::placeholders::_2));
}
void chatbox::finalize_setup()
@ -89,7 +89,7 @@ void chatbox::finalize_setup()
chat_input_ = find_widget<text_box>(this, "chat_input", false, true);
connect_signal_pre_key_press(*chat_input_,
std::bind(&chatbox::chat_input_keypress_callback, this, _5));
std::bind(&chatbox::chat_input_keypress_callback, this, std::placeholders::_5));
}
void chatbox::load_log(std::map<std::string, chatroom_log>& log, bool show_lobby)
@ -456,7 +456,7 @@ lobby_chat_window* chatbox::find_or_create_window(const std::string& name,
close_button.set_visible(widget::visibility::hidden);
} else {
connect_signal_mouse_left_click(close_button,
std::bind(&chatbox::close_window_button_callback, this, open_windows_.back().name, _3, _4));
std::bind(&chatbox::close_window_button_callback, this, open_windows_.back().name, std::placeholders::_3, std::placeholders::_4));
}
return &open_windows_.back();

View file

@ -1048,7 +1048,7 @@ void selection::init(grid* g,
toggle_panel* panel = dynamic_cast<toggle_panel*>(widget);
if(btn) {
connect_signal_notify_modified(*btn, std::bind(callback, _1));
connect_signal_notify_modified(*btn, std::bind(callback, std::placeholders::_1));
std::map<std::string, string_map>::const_iterator itor = data.find(btn->id());
@ -1059,7 +1059,7 @@ void selection::init(grid* g,
btn->set_members(itor->second);
}
} else if(panel) {
connect_signal_notify_modified(*panel, std::bind(callback, _1));
connect_signal_notify_modified(*panel, std::bind(callback, std::placeholders::_1));
panel->set_child_members(data);
} else if(child_grid) {

View file

@ -127,7 +127,7 @@ public:
};
for(auto& member : members_) {
event::connect_signal_notify_modified(dynamic_cast<widget&>(*member.second), std::bind(callback, _1));
event::connect_signal_notify_modified(dynamic_cast<widget&>(*member.second), std::bind(callback, std::placeholders::_1));
}
}

View file

@ -50,8 +50,8 @@ label::label(const implementation::builder_label& builder)
, can_shrink_(false)
, text_alpha_(255)
{
connect_signal<event::LEFT_BUTTON_CLICK>(std::bind(&label::signal_handler_left_button_click, this, _2, _3));
connect_signal<event::RIGHT_BUTTON_CLICK>(std::bind(&label::signal_handler_right_button_click, this, _2, _3));
connect_signal<event::LEFT_BUTTON_CLICK>(std::bind(&label::signal_handler_left_button_click, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::RIGHT_BUTTON_CLICK>(std::bind(&label::signal_handler_right_button_click, this, std::placeholders::_2, std::placeholders::_3));
}
bool label::can_wrap() const

View file

@ -67,7 +67,7 @@ listbox::listbox(const implementation::builder_styled_widget& builder,
grid& listbox::add_row(const string_map& item, const int index)
{
assert(generator_);
grid& row = generator_->create_item(index, *list_builder_, item, std::bind(&listbox::list_item_clicked, this, _1));
grid& row = generator_->create_item(index, *list_builder_, item, std::bind(&listbox::list_item_clicked, this, std::placeholders::_1));
resize_content(row);
@ -77,7 +77,7 @@ grid& listbox::add_row(const string_map& item, const int index)
grid& listbox::add_row(const std::map<std::string /* widget id */, string_map>& data, const int index)
{
assert(generator_);
grid& row = generator_->create_item(index, *list_builder_, data, std::bind(&listbox::list_item_clicked, this, _1));
grid& row = generator_->create_item(index, *list_builder_, data, std::bind(&listbox::list_item_clicked, this, std::placeholders::_1));
resize_content(row);
@ -568,7 +568,7 @@ void listbox::finalize(builder_grid_const_ptr header,
//
if(toggle_button* selectable = find_widget<toggle_button>(&p, "sort_" + std::to_string(i), false, false)) {
// Register callback to sort the list.
connect_signal_notify_modified(*selectable, std::bind(&listbox::order_by_column, this, i, _1));
connect_signal_notify_modified(*selectable, std::bind(&listbox::order_by_column, this, i, std::placeholders::_1));
if(orders_.size() < max) {
orders_.resize(max);
@ -582,7 +582,7 @@ void listbox::finalize(builder_grid_const_ptr header,
swap_grid(&get_grid(), content_grid(), footer->build(), "_footer_grid");
}
generator_->create_items(-1, *list_builder_, list_data, std::bind(&listbox::list_item_clicked, this, _1));
generator_->create_items(-1, *list_builder_, list_data, std::bind(&listbox::list_item_clicked, this, std::placeholders::_1));
swap_grid(nullptr, content_grid(), generator_, "_list_grid");
}

View file

@ -48,26 +48,26 @@ menu_button::menu_button(const implementation::builder_menu_button& builder)
values_.emplace_back("label", this->get_label());
connect_signal<event::MOUSE_ENTER>(
std::bind(&menu_button::signal_handler_mouse_enter, this, _2, _3));
std::bind(&menu_button::signal_handler_mouse_enter, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::MOUSE_LEAVE>(
std::bind(&menu_button::signal_handler_mouse_leave, this, _2, _3));
std::bind(&menu_button::signal_handler_mouse_leave, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::LEFT_BUTTON_DOWN>(
std::bind(&menu_button::signal_handler_left_button_down, this, _2, _3));
std::bind(&menu_button::signal_handler_left_button_down, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::LEFT_BUTTON_UP>(
std::bind(&menu_button::signal_handler_left_button_up, this, _2, _3));
std::bind(&menu_button::signal_handler_left_button_up, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::LEFT_BUTTON_CLICK>(
std::bind(&menu_button::signal_handler_left_button_click, this, _2, _3));
std::bind(&menu_button::signal_handler_left_button_click, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::SDL_WHEEL_UP>(
std::bind(&menu_button::signal_handler_sdl_wheel_up, this, _2, _3),
std::bind(&menu_button::signal_handler_sdl_wheel_up, this, std::placeholders::_2, std::placeholders::_3),
event::dispatcher::back_post_child);
connect_signal<event::SDL_WHEEL_DOWN>(
std::bind(&menu_button::signal_handler_sdl_wheel_down, this, _2, _3),
std::bind(&menu_button::signal_handler_sdl_wheel_down, this, std::placeholders::_2, std::placeholders::_3),
event::dispatcher::back_post_child);
}

View file

@ -50,16 +50,16 @@ multimenu_button::multimenu_button(const implementation::builder_multimenu_butto
values_.emplace_back("label", this->get_label());
connect_signal<event::MOUSE_ENTER>(
std::bind(&multimenu_button::signal_handler_mouse_enter, this, _2, _3));
std::bind(&multimenu_button::signal_handler_mouse_enter, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::MOUSE_LEAVE>(
std::bind(&multimenu_button::signal_handler_mouse_leave, this, _2, _3));
std::bind(&multimenu_button::signal_handler_mouse_leave, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::LEFT_BUTTON_DOWN>(
std::bind(&multimenu_button::signal_handler_left_button_down, this, _2, _3));
std::bind(&multimenu_button::signal_handler_left_button_down, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::LEFT_BUTTON_UP>(
std::bind(&multimenu_button::signal_handler_left_button_up, this, _2, _3));
std::bind(&multimenu_button::signal_handler_left_button_up, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::LEFT_BUTTON_CLICK>(
std::bind(&multimenu_button::signal_handler_left_button_click, this, _2, _3));
std::bind(&multimenu_button::signal_handler_left_button_click, this, std::placeholders::_2, std::placeholders::_3));
// TODO: might need to position this differently in the queue if it's called after
// dialog-specific callbacks.

View file

@ -113,7 +113,7 @@ pane::pane(const builder_grid_ptr item_builder)
{
connect_signal<event::REQUEST_PLACEMENT>(
std::bind(
&pane::signal_handler_request_placement, this, _1, _2, _3),
&pane::signal_handler_request_placement, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3),
event::dispatcher::back_pre_child);
}
@ -126,7 +126,7 @@ pane::pane(const implementation::builder_pane& builder)
{
connect_signal<event::REQUEST_PLACEMENT>(
std::bind(
&pane::signal_handler_request_placement, this, _1, _2, _3),
&pane::signal_handler_request_placement, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3),
event::dispatcher::back_pre_child);
}

View file

@ -42,14 +42,14 @@ repeating_button::repeating_button(const implementation::builder_repeating_butto
, repeat_timer_(0)
{
connect_signal<event::MOUSE_ENTER>(std::bind(
&repeating_button::signal_handler_mouse_enter, this, _2, _3));
&repeating_button::signal_handler_mouse_enter, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::MOUSE_LEAVE>(std::bind(
&repeating_button::signal_handler_mouse_leave, this, _2, _3));
&repeating_button::signal_handler_mouse_leave, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::LEFT_BUTTON_DOWN>(std::bind(
&repeating_button::signal_handler_left_button_down, this, _2, _3));
&repeating_button::signal_handler_left_button_down, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::LEFT_BUTTON_UP>(std::bind(
&repeating_button::signal_handler_left_button_up, this, _2, _3));
&repeating_button::signal_handler_left_button_up, this, std::placeholders::_2, std::placeholders::_3));
}
repeating_button::~repeating_button()

View file

@ -46,7 +46,7 @@ scroll_label::scroll_label(const implementation::builder_scroll_label& builder)
, text_alignment_(builder.text_alignment)
{
connect_signal<event::LEFT_BUTTON_DOWN>(
std::bind(&scroll_label::signal_handler_left_button_down, this, _2),
std::bind(&scroll_label::signal_handler_left_button_down, this, std::placeholders::_2),
event::dispatcher::back_pre_child);
}

View file

@ -40,17 +40,17 @@ scrollbar_base::scrollbar_base(const implementation::builder_styled_widget& buil
, positioner_length_(0)
{
connect_signal<event::MOUSE_ENTER>(std::bind(
&scrollbar_base::signal_handler_mouse_enter, this, _2, _3, _4));
&scrollbar_base::signal_handler_mouse_enter, this, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4));
connect_signal<event::MOUSE_MOTION>(std::bind(
&scrollbar_base::signal_handler_mouse_motion, this, _2, _3, _4, _5));
&scrollbar_base::signal_handler_mouse_motion, this, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5));
connect_signal<event::SDL_TOUCH_MOTION>(std::bind(
&scrollbar_base::signal_handler_mouse_motion, this, _2, _3, _4, _5));
&scrollbar_base::signal_handler_mouse_motion, this, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5));
connect_signal<event::MOUSE_LEAVE>(std::bind(
&scrollbar_base::signal_handler_mouse_leave, this, _2, _3));
&scrollbar_base::signal_handler_mouse_leave, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::LEFT_BUTTON_DOWN>(std::bind(
&scrollbar_base::signal_handler_left_button_down, this, _2, _3));
&scrollbar_base::signal_handler_left_button_down, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::LEFT_BUTTON_UP>(std::bind(
&scrollbar_base::signal_handler_left_button_up, this, _2, _3));
&scrollbar_base::signal_handler_left_button_up, this, std::placeholders::_2, std::placeholders::_3));
}
void scrollbar_base::finalize_setup()

View file

@ -81,31 +81,31 @@ scrollbar_container::scrollbar_container(
, content_visible_area_()
{
connect_signal<event::SDL_KEY_DOWN>(
std::bind(&scrollbar_container::signal_handler_sdl_key_down, this, _2, _3, _5, _6));
std::bind(&scrollbar_container::signal_handler_sdl_key_down, this, std::placeholders::_2, std::placeholders::_3, std::placeholders::_5, std::placeholders::_6));
connect_signal<event::SDL_WHEEL_UP>(
std::bind(&scrollbar_container::signal_handler_sdl_wheel_up, this, _2, _3),
std::bind(&scrollbar_container::signal_handler_sdl_wheel_up, this, std::placeholders::_2, std::placeholders::_3),
event::dispatcher::back_post_child);
connect_signal<event::SDL_WHEEL_DOWN>(
std::bind(&scrollbar_container::signal_handler_sdl_wheel_down, this, _2, _3),
std::bind(&scrollbar_container::signal_handler_sdl_wheel_down, this, std::placeholders::_2, std::placeholders::_3),
event::dispatcher::back_post_child);
connect_signal<event::SDL_WHEEL_LEFT>(
std::bind(&scrollbar_container::signal_handler_sdl_wheel_left, this, _2, _3),
std::bind(&scrollbar_container::signal_handler_sdl_wheel_left, this, std::placeholders::_2, std::placeholders::_3),
event::dispatcher::back_post_child);
connect_signal<event::SDL_WHEEL_RIGHT>(
std::bind(&scrollbar_container::signal_handler_sdl_wheel_right, this, _2, _3),
std::bind(&scrollbar_container::signal_handler_sdl_wheel_right, this, std::placeholders::_2, std::placeholders::_3),
event::dispatcher::back_post_child);
connect_signal<event::SDL_TOUCH_MOTION>(
std::bind(&scrollbar_container::signal_handler_sdl_touch_motion,
this,
_2,
_3,
_5,
_6),
std::placeholders::_2,
std::placeholders::_3,
std::placeholders::_5,
std::placeholders::_6),
event::dispatcher::back_post_child);
}

View file

@ -56,12 +56,12 @@ slider::slider(const implementation::builder_slider& builder)
, value_label_generator_()
, current_item_mouse_position_(0, 0)
{
connect_signal<event::SDL_KEY_DOWN>(std::bind(&slider::signal_handler_sdl_key_down, this, _2, _3, _5));
connect_signal<event::SDL_KEY_DOWN>(std::bind(&slider::signal_handler_sdl_key_down, this, std::placeholders::_2, std::placeholders::_3, std::placeholders::_5));
// connect_signal<event::LEFT_BUTTON_DOWN>(
// std::bind(&slider::signal_handler_left_button_down, this, _2, _3));
// std::bind(&slider::signal_handler_left_button_down, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::LEFT_BUTTON_UP>(std::bind(&slider::signal_handler_left_button_up, this, _2, _3));
connect_signal<event::LEFT_BUTTON_UP>(std::bind(&slider::signal_handler_left_button_up, this, std::placeholders::_2, std::placeholders::_3));
}
point slider::calculate_best_size() const
@ -247,7 +247,7 @@ static t_string default_value_label_generator(const std::vector<t_string>& value
void slider::set_value_labels(const std::vector<t_string>& value_labels)
{
// Don't use std::ref because we want to store value_labels in the closure.
set_value_labels(std::bind(&default_value_label_generator, value_labels, _1, _2));
set_value_labels(std::bind(&default_value_label_generator, value_labels, std::placeholders::_1, std::placeholders::_2));
}

View file

@ -51,15 +51,15 @@ slider_base::slider_base(const implementation::builder_styled_widget& builder, c
, snap_(true)
{
connect_signal<event::MOUSE_ENTER>(
std::bind(&slider_base::signal_handler_mouse_enter, this, _2, _3, _4));
std::bind(&slider_base::signal_handler_mouse_enter, this, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4));
connect_signal<event::MOUSE_MOTION>(
std::bind(&slider_base::signal_handler_mouse_motion, this, _2, _3, _4, _5));
std::bind(&slider_base::signal_handler_mouse_motion, this, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5));
connect_signal<event::MOUSE_LEAVE>(
std::bind(&slider_base::signal_handler_mouse_leave, this, _2, _3));
std::bind(&slider_base::signal_handler_mouse_leave, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::LEFT_BUTTON_DOWN>(
std::bind(&slider_base::signal_handler_left_button_down, this, _2, _3));
std::bind(&slider_base::signal_handler_left_button_down, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::LEFT_BUTTON_UP>(
std::bind(&slider_base::signal_handler_left_button_up, this, _2, _3));
std::bind(&slider_base::signal_handler_left_button_up, this, std::placeholders::_2, std::placeholders::_3));
}
void slider_base::scroll(const scroll_mode scroll)

View file

@ -77,13 +77,13 @@ styled_widget::styled_widget(const implementation::builder_styled_widget& builde
set_wants_mouse_hover(!tooltip_.empty());
connect_signal<event::SHOW_TOOLTIP>(std::bind(
&styled_widget::signal_handler_show_tooltip, this, _2, _3, _5));
&styled_widget::signal_handler_show_tooltip, this, std::placeholders::_2, std::placeholders::_3, std::placeholders::_5));
connect_signal<event::SHOW_HELPTIP>(std::bind(
&styled_widget::signal_handler_show_helptip, this, _2, _3, _5));
&styled_widget::signal_handler_show_helptip, this, std::placeholders::_2, std::placeholders::_3, std::placeholders::_5));
connect_signal<event::NOTIFY_REMOVE_TOOLTIP>(std::bind(
&styled_widget::signal_handler_notify_remove_tooltip, this, _2, _3));
&styled_widget::signal_handler_notify_remove_tooltip, this, std::placeholders::_2, std::placeholders::_3));
}
void styled_widget::set_members(const string_map& data)

View file

@ -107,13 +107,13 @@ text_box::text_box(const implementation::builder_styled_widget& builder)
set_wants_mouse_left_double_click();
connect_signal<event::MOUSE_MOTION>(std::bind(
&text_box::signal_handler_mouse_motion, this, _2, _3, _5));
&text_box::signal_handler_mouse_motion, this, std::placeholders::_2, std::placeholders::_3, std::placeholders::_5));
connect_signal<event::LEFT_BUTTON_DOWN>(std::bind(
&text_box::signal_handler_left_button_down, this, _2, _3));
&text_box::signal_handler_left_button_down, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::LEFT_BUTTON_UP>(std::bind(
&text_box::signal_handler_left_button_up, this, _2, _3));
&text_box::signal_handler_left_button_up, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::LEFT_BUTTON_DOUBLE_CLICK>(std::bind(
&text_box::signal_handler_left_button_double_click, this, _2, _3));
&text_box::signal_handler_left_button_double_click, this, std::placeholders::_2, std::placeholders::_3));
const auto conf = cast_config_to<text_box_definition>();
assert(conf);

View file

@ -48,24 +48,24 @@ text_box_base::text_box_base(const implementation::builder_styled_widget& builde
#ifdef __unix__
// pastes on UNIX systems.
connect_signal<event::MIDDLE_BUTTON_CLICK>(std::bind(
&text_box_base::signal_handler_middle_button_click, this, _2, _3));
&text_box_base::signal_handler_middle_button_click, this, std::placeholders::_2, std::placeholders::_3));
#endif
connect_signal<event::SDL_KEY_DOWN>(std::bind(
&text_box_base::signal_handler_sdl_key_down, this, _2, _3, _5, _6));
connect_signal<event::SDL_TEXT_INPUT>(std::bind(&text_box_base::handle_commit, this, _3, _5));
connect_signal<event::SDL_TEXT_EDITING>(std::bind(&text_box_base::handle_editing, this, _3, _5, _6, _7));
&text_box_base::signal_handler_sdl_key_down, this, std::placeholders::_2, std::placeholders::_3, std::placeholders::_5, std::placeholders::_6));
connect_signal<event::SDL_TEXT_INPUT>(std::bind(&text_box_base::handle_commit, this, std::placeholders::_3, std::placeholders::_5));
connect_signal<event::SDL_TEXT_EDITING>(std::bind(&text_box_base::handle_editing, this, std::placeholders::_3, std::placeholders::_5, std::placeholders::_6, std::placeholders::_7));
connect_signal<event::RECEIVE_KEYBOARD_FOCUS>(std::bind(
&text_box_base::signal_handler_receive_keyboard_focus, this, _2));
&text_box_base::signal_handler_receive_keyboard_focus, this, std::placeholders::_2));
connect_signal<event::LOSE_KEYBOARD_FOCUS>(
std::bind(&text_box_base::signal_handler_lose_keyboard_focus, this, _2));
std::bind(&text_box_base::signal_handler_lose_keyboard_focus, this, std::placeholders::_2));
connect_signal<event::MOUSE_ENTER>(
std::bind(&text_box_base::signal_handler_mouse_enter, this, _2, _3));
std::bind(&text_box_base::signal_handler_mouse_enter, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::MOUSE_LEAVE>(
std::bind(&text_box_base::signal_handler_mouse_leave, this, _2, _3));
std::bind(&text_box_base::signal_handler_mouse_leave, this, std::placeholders::_2, std::placeholders::_3));
toggle_cursor_timer(true);
}

View file

@ -43,17 +43,17 @@ toggle_button::toggle_button(const implementation::builder_toggle_button& builde
, icon_name_()
{
connect_signal<event::MOUSE_ENTER>(std::bind(
&toggle_button::signal_handler_mouse_enter, this, _2, _3));
&toggle_button::signal_handler_mouse_enter, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::MOUSE_LEAVE>(std::bind(
&toggle_button::signal_handler_mouse_leave, this, _2, _3));
&toggle_button::signal_handler_mouse_leave, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::LEFT_BUTTON_CLICK>(std::bind(
&toggle_button::signal_handler_left_button_click, this, _2, _3));
&toggle_button::signal_handler_left_button_click, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::LEFT_BUTTON_DOUBLE_CLICK>(std::bind(
&toggle_button::signal_handler_left_button_double_click,
this,
_2,
_3));
std::placeholders::_2,
std::placeholders::_3));
}
unsigned toggle_button::num_states() const

View file

@ -46,34 +46,34 @@ toggle_panel::toggle_panel(const implementation::builder_toggle_panel& builder)
set_wants_mouse_left_double_click();
connect_signal<event::MOUSE_ENTER>(std::bind(
&toggle_panel::signal_handler_mouse_enter, this, _2, _3));
&toggle_panel::signal_handler_mouse_enter, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::MOUSE_LEAVE>(std::bind(
&toggle_panel::signal_handler_mouse_leave, this, _2, _3));
&toggle_panel::signal_handler_mouse_leave, this, std::placeholders::_2, std::placeholders::_3));
#if 0
connect_signal<event::LEFT_BUTTON_CLICK>(
std::bind(&toggle_panel::signal_handler_pre_left_button_click,
this,
_2),
std::placeholders::_2),
event::dispatcher::back_pre_child);
#endif
connect_signal<event::LEFT_BUTTON_CLICK>(std::bind(
&toggle_panel::signal_handler_left_button_click, this, _2, _3));
&toggle_panel::signal_handler_left_button_click, this, std::placeholders::_2, std::placeholders::_3));
connect_signal<event::LEFT_BUTTON_CLICK>(
std::bind(&toggle_panel::signal_handler_left_button_click,
this,
_2,
_3),
std::placeholders::_2,
std::placeholders::_3),
event::dispatcher::back_post_child);
connect_signal<event::LEFT_BUTTON_DOUBLE_CLICK>(
std::bind(&toggle_panel::signal_handler_left_button_double_click,
this,
_2,
_3));
std::placeholders::_2,
std::placeholders::_3));
connect_signal<event::LEFT_BUTTON_DOUBLE_CLICK>(
std::bind(&toggle_panel::signal_handler_left_button_double_click,
this,
_2,
_3),
std::placeholders::_2,
std::placeholders::_3),
event::dispatcher::back_post_child);
}

View file

@ -43,7 +43,7 @@ tree_view::tree_view(const implementation::builder_tree_view& builder)
, selected_item_(nullptr)
{
connect_signal<event::LEFT_BUTTON_DOWN>(
std::bind(&tree_view::signal_handler_left_button_down, this, _2), event::dispatcher::back_pre_child);
std::bind(&tree_view::signal_handler_left_button_down, this, std::placeholders::_2), event::dispatcher::back_pre_child);
}
tree_view::~tree_view()

View file

@ -75,10 +75,10 @@ tree_view_node::tree_view_node(const std::string& id,
toggle_widget->set_visible(widget::visibility::hidden);
toggle_widget->connect_signal<event::LEFT_BUTTON_CLICK>(
std::bind(&tree_view_node::signal_handler_left_button_click, this, _2));
std::bind(&tree_view_node::signal_handler_left_button_click, this, std::placeholders::_2));
toggle_widget->connect_signal<event::LEFT_BUTTON_CLICK>(
std::bind(&tree_view_node::signal_handler_left_button_click, this, _2),
std::bind(&tree_view_node::signal_handler_left_button_click, this, std::placeholders::_2),
event::dispatcher::back_post_child);
if(unfolded_) {
@ -91,11 +91,11 @@ tree_view_node::tree_view_node(const std::string& id,
if(label_) {
label_widget->connect_signal<event::LEFT_BUTTON_CLICK>(
std::bind(&tree_view_node::signal_handler_label_left_button_click, this, _2, _3, _4),
std::bind(&tree_view_node::signal_handler_label_left_button_click, this, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4),
event::dispatcher::front_child);
label_widget->connect_signal<event::LEFT_BUTTON_CLICK>(
std::bind(&tree_view_node::signal_handler_label_left_button_click, this, _2, _3, _4),
std::bind(&tree_view_node::signal_handler_label_left_button_click, this, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4),
event::dispatcher::front_pre_child);
if(!get_tree_view().selected_item_) {

View file

@ -321,7 +321,7 @@ window::window(const builder_window::window_resolution& definition)
}
connect_signal<event::SDL_VIDEO_RESIZE>(std::bind(
&window::signal_handler_sdl_video_resize, this, _2, _3, _5));
&window::signal_handler_sdl_video_resize, this, std::placeholders::_2, std::placeholders::_3, std::placeholders::_5));
connect_signal<event::SDL_ACTIVATE>(std::bind(
&event::distributor::initialize_state, event_distributor_.get()));
@ -329,54 +329,54 @@ window::window(const builder_window::window_resolution& definition)
connect_signal<event::SDL_LEFT_BUTTON_UP>(
std::bind(&window::signal_handler_click_dismiss,
this,
_2,
_3,
_4,
std::placeholders::_2,
std::placeholders::_3,
std::placeholders::_4,
SDL_BUTTON_LMASK),
event::dispatcher::front_child);
connect_signal<event::SDL_MIDDLE_BUTTON_UP>(
std::bind(&window::signal_handler_click_dismiss,
this,
_2,
_3,
_4,
std::placeholders::_2,
std::placeholders::_3,
std::placeholders::_4,
SDL_BUTTON_MMASK),
event::dispatcher::front_child);
connect_signal<event::SDL_RIGHT_BUTTON_UP>(
std::bind(&window::signal_handler_click_dismiss,
this,
_2,
_3,
_4,
std::placeholders::_2,
std::placeholders::_3,
std::placeholders::_4,
SDL_BUTTON_RMASK),
event::dispatcher::front_child);
connect_signal<event::SDL_KEY_DOWN>(
std::bind(
&window::signal_handler_sdl_key_down, this, _2, _3, _5, _6, true),
&window::signal_handler_sdl_key_down, this, std::placeholders::_2, std::placeholders::_3, std::placeholders::_5, std::placeholders::_6, true),
event::dispatcher::back_post_child);
connect_signal<event::SDL_KEY_DOWN>(std::bind(
&window::signal_handler_sdl_key_down, this, _2, _3, _5, _6, false));
&window::signal_handler_sdl_key_down, this, std::placeholders::_2, std::placeholders::_3, std::placeholders::_5, std::placeholders::_6, false));
connect_signal<event::MESSAGE_SHOW_TOOLTIP>(
std::bind(&window::signal_handler_message_show_tooltip,
this,
_2,
_3,
_5),
std::placeholders::_2,
std::placeholders::_3,
std::placeholders::_5),
event::dispatcher::back_pre_child);
connect_signal<event::MESSAGE_SHOW_HELPTIP>(
std::bind(&window::signal_handler_message_show_helptip,
this,
_2,
_3,
_5),
std::placeholders::_2,
std::placeholders::_3,
std::placeholders::_5),
event::dispatcher::back_pre_child);
connect_signal<event::REQUEST_PLACEMENT>(
std::bind(
&window::signal_handler_request_placement, this, _2, _3),
&window::signal_handler_request_placement, this, std::placeholders::_2, std::placeholders::_3),
event::dispatcher::back_pre_child);
connect_signal<event::CLOSE_WINDOW>(std::bind(&window::signal_handler_close_window, this));

View file

@ -70,7 +70,7 @@ connection::connection(const std::string& host, const std::string& service)
, bytes_read_(0)
{
resolver_.async_resolve(
boost::asio::ip::tcp::resolver::query(host, service), std::bind(&connection::handle_resolve, this, _1, _2));
boost::asio::ip::tcp::resolver::query(host, service), std::bind(&connection::handle_resolve, this, std::placeholders::_1, std::placeholders::_2));
LOG_NW << "Resolving hostname: " << host << '\n';
}
@ -86,7 +86,7 @@ void connection::handle_resolve(const boost::system::error_code& ec, resolver::i
void connection::connect(resolver::iterator iterator)
{
socket_.async_connect(*iterator, std::bind(&connection::handle_connect, this, _1, iterator));
socket_.async_connect(*iterator, std::bind(&connection::handle_connect, this, std::placeholders::_1, iterator));
LOG_NW << "Connecting to " << iterator->endpoint().address() << '\n';
}
@ -113,10 +113,10 @@ void connection::handshake()
static const uint32_t handshake = 0;
boost::asio::async_write(socket_, boost::asio::buffer(reinterpret_cast<const char*>(&handshake), 4),
std::bind(&connection::handle_write, this, _1, _2));
std::bind(&connection::handle_write, this, std::placeholders::_1, std::placeholders::_2));
boost::asio::async_read(socket_, boost::asio::buffer(&handshake_response_.binary, 4),
std::bind(&connection::handle_handshake, this, _1));
std::bind(&connection::handle_handshake, this, std::placeholders::_1));
}
void connection::handle_handshake(const boost::system::error_code& ec)
@ -147,11 +147,11 @@ void connection::transfer(const config& request, config& response)
bufs.push_front(boost::asio::buffer(reinterpret_cast<const char*>(&payload_size_), 4));
boost::asio::async_write(socket_, bufs, std::bind(&connection::is_write_complete, this, _1, _2),
std::bind(&connection::handle_write, this, _1, _2));
boost::asio::async_write(socket_, bufs, std::bind(&connection::is_write_complete, this, std::placeholders::_1, std::placeholders::_2),
std::bind(&connection::handle_write, this, std::placeholders::_1, std::placeholders::_2));
boost::asio::async_read(socket_, *read_buf_, std::bind(&connection::is_read_complete, this, _1, _2),
std::bind(&connection::handle_read, this, _1, _2, std::ref(response)));
boost::asio::async_read(socket_, *read_buf_, std::bind(&connection::is_read_complete, this, std::placeholders::_1, std::placeholders::_2),
std::bind(&connection::handle_read, this, std::placeholders::_1, std::placeholders::_2, std::ref(response)));
}
void connection::cancel()

View file

@ -168,5 +168,5 @@ static bool read_config(config& src, config& dst)
playturn_network_adapter::source_type playturn_network_adapter::get_source_from_config(config& cfg)
{
return std::bind(read_config, std::ref(cfg), _1);
return std::bind(read_config, std::ref(cfg), std::placeholders::_1);
}

View file

@ -191,7 +191,7 @@ application_lua_kernel::thread * application_lua_kernel::load_script_from_string
throw game::lua_error(msg, context);
}
if (!lua_kernel_base::protected_call(T, 0, 1, std::bind(&lua_kernel_base::log_error, this, _1, _2))) {
if (!lua_kernel_base::protected_call(T, 0, 1, std::bind(&lua_kernel_base::log_error, this, std::placeholders::_1, std::placeholders::_2))) {
throw game::lua_error("Error when executing a script to make a lua thread.");
}
if (!lua_isfunction(T, -1)) {
@ -208,7 +208,7 @@ application_lua_kernel::thread * application_lua_kernel::load_script_from_file(c
lua_pushstring(T, file.c_str());
lua_fileops::load_file(T);
if (!lua_kernel_base::protected_call(T, 0, 1, std::bind(&lua_kernel_base::log_error, this, _1, _2))) {
if (!lua_kernel_base::protected_call(T, 0, 1, std::bind(&lua_kernel_base::log_error, this, std::placeholders::_1, std::placeholders::_2))) {
throw game::lua_error("Error when executing a file to make a lua thread.");
}
if (!lua_isfunction(T, -1)) {
@ -283,7 +283,7 @@ application_lua_kernel::request_list application_lua_kernel::thread::run_script(
lua_newtable(T_); // this will be the context table
for (const std::string & key : ctxt.callbacks_ | boost::adaptors::map_keys ) {
lua_pushstring(T_, key.c_str());
lua_cpp::push_function(T_, std::bind(&impl_context_backend, _1, this_context_backend, key));
lua_cpp::push_function(T_, std::bind(&impl_context_backend, std::placeholders::_1, this_context_backend, key));
lua_settable(T_, -3);
}
@ -296,7 +296,7 @@ application_lua_kernel::request_list application_lua_kernel::thread::run_script(
const std::string & key = v.first;
const plugins_context::accessor_function & func = v.second;
lua_pushstring(T_, key.c_str());
lua_cpp::push_function(T_, std::bind(&impl_context_accessor, _1, this_context_backend, func));
lua_cpp::push_function(T_, std::bind(&impl_context_accessor, std::placeholders::_1, this_context_backend, func));
lua_settable(T_, -3);
}

View file

@ -3891,7 +3891,7 @@ int game_lua_kernel::impl_theme_item(lua_State *L, std::string m)
int game_lua_kernel::impl_theme_items_get(lua_State *L)
{
char const *m = luaL_checkstring(L, 2);
lua_cpp::push_closure(L, std::bind(&game_lua_kernel::impl_theme_item, this, _1, std::string(m)), 0);
lua_cpp::push_closure(L, std::bind(&game_lua_kernel::impl_theme_item, this, std::placeholders::_1, std::string(m)), 0);
lua_pushvalue(L, 2);
lua_pushvalue(L, -2);
lua_rawset(L, 1);
@ -4395,9 +4395,9 @@ game_lua_kernel::game_lua_kernel(game_state & gs, play_controller & pc, reports
{ nullptr, nullptr }
};
std::vector<lua_cpp::Reg> const cpp_side_callbacks {
{"add_ai_component", std::bind(intf_modify_ai, _1, "add")},
{"delete_ai_component", std::bind(intf_modify_ai, _1, "delete")},
{"change_ai_component", std::bind(intf_modify_ai, _1, "change")},
{"add_ai_component", std::bind(intf_modify_ai, std::placeholders::_1, "add")},
{"delete_ai_component", std::bind(intf_modify_ai, std::placeholders::_1, "delete")},
{"change_ai_component", std::bind(intf_modify_ai, std::placeholders::_1, "change")},
{nullptr, nullptr}
};

View file

@ -285,7 +285,7 @@ int luaW_open(lua_State* L)
{ nullptr, nullptr },
};
std::vector<lua_cpp::Reg> const cpp_gui_callbacks {
{"show_lua_console", std::bind(&lua_kernel_base::intf_show_lua_console, &lk, _1)},
{"show_lua_console", std::bind(&lua_kernel_base::intf_show_lua_console, &lk, std::placeholders::_1)},
{nullptr, nullptr}
};
lua_newtable(L);

View file

@ -584,7 +584,7 @@ lua_kernel_base::lua_kernel_base()
//run "ilua.set_strict()"
lua_pushstring(L, "set_strict");
lua_gettable(L, -2);
if (!this->protected_call(0,0, std::bind(&lua_kernel_base::log_error, this, _1, _2))) {
if (!this->protected_call(0,0, std::bind(&lua_kernel_base::log_error, this, std::placeholders::_1, std::placeholders::_2))) {
cmd_log_ << "Failed to activate strict mode.\n";
} else {
cmd_log_ << "Activated strict mode.\n";
@ -630,13 +630,13 @@ void lua_kernel_base::throw_exception(char const * msg, char const * context)
bool lua_kernel_base::protected_call(int nArgs, int nRets)
{
error_handler eh = std::bind(&lua_kernel_base::log_error, this, _1, _2 );
error_handler eh = std::bind(&lua_kernel_base::log_error, this, std::placeholders::_1, std::placeholders::_2 );
return this->protected_call(nArgs, nRets, eh);
}
bool lua_kernel_base::load_string(char const * prog, const std::string& name)
{
error_handler eh = std::bind(&lua_kernel_base::log_error, this, _1, _2 );
error_handler eh = std::bind(&lua_kernel_base::log_error, this, std::placeholders::_1, std::placeholders::_2 );
return this->load_string(prog, name, eh);
}
@ -723,7 +723,7 @@ void lua_kernel_base::run_lua_tag(const config& cfg)
void lua_kernel_base::throwing_run(const char * prog, const std::string& name, int nArgs, bool in_interpreter)
{
cmd_log_ << "$ " << prog << "\n";
error_handler eh = std::bind(&lua_kernel_base::throw_exception, this, _1, _2 );
error_handler eh = std::bind(&lua_kernel_base::throw_exception, this, std::placeholders::_1, std::placeholders::_2 );
this->load_string(prog, name, eh);
if(in_interpreter) {
lua_getfield(mState, LUA_REGISTRYINDEX, Interp);
@ -751,7 +751,7 @@ void lua_kernel_base::interactive_run(char const * prog) {
experiment += prog;
int top = lua_gettop(mState);
error_handler eh = std::bind(&lua_kernel_base::throw_exception, this, _1, _2 );
error_handler eh = std::bind(&lua_kernel_base::throw_exception, this, std::placeholders::_1, std::placeholders::_2 );
luaW_getglobal(mState, "ilua", "_pretty_print");
try {
@ -843,7 +843,7 @@ int lua_kernel_base::intf_require(lua_State* L)
}
DBG_LUA << "require: loaded a file, now calling it\n";
if (!this->protected_call(L, 0, 1, std::bind(&lua_kernel_base::log_error, this, _1, _2))) {
if (!this->protected_call(L, 0, 1, std::bind(&lua_kernel_base::log_error, this, std::placeholders::_1, std::placeholders::_2))) {
// historically if wesnoth.require fails it just yields nil and some logging messages, not a lua error
return 0;
}

View file

@ -243,9 +243,9 @@ mapgen_lua_kernel::mapgen_lua_kernel(const config* vars)
void mapgen_lua_kernel::run_generator(const char * prog, const config & generator)
{
load_string(prog, "", std::bind(&lua_kernel_base::throw_exception, this, _1, _2));
load_string(prog, "", std::bind(&lua_kernel_base::throw_exception, this, std::placeholders::_1, std::placeholders::_2));
luaW_pushconfig(mState, generator);
protected_call(1, 1, std::bind(&lua_kernel_base::throw_exception, this, _1, _2));
protected_call(1, 1, std::bind(&lua_kernel_base::throw_exception, this, std::placeholders::_1, std::placeholders::_2));
}
void mapgen_lua_kernel::user_config(const char * prog, const config & generator)

View file

@ -298,7 +298,7 @@ void schema_validator::validate(const config& cfg, const std::string& name, int
queue_message(cfg, EXTRA_TAG, file, start_line, tag.second.get_max(), tag.first, "", name);
}
}
int total_cnt = counter_.top()[""].cnt;
if(active.get_min_children() > total_cnt) {
queue_message(cfg, MISSING_TAG, file, start_line, active.get_min_children(), "*", "", active.get_name());
@ -534,12 +534,12 @@ void schema_self_validator::validate(const config& cfg, const std::string& name,
using namespace std::placeholders;
std::vector<reference> missing_types = referenced_types_, missing_tags = referenced_tag_paths_;
// Remove all the known types
missing_types.erase(std::remove_if(missing_types.begin(), missing_types.end(), std::bind(&reference::match, _1, std::cref(defined_types_))), missing_types.end());
missing_types.erase(std::remove_if(missing_types.begin(), missing_types.end(), std::bind(&reference::match, std::placeholders::_1, std::cref(defined_types_))), missing_types.end());
// Remove all the known tags. This is more complicated since links behave similar to a symbolic link.
// In other words, the presence of links means there may be more than one way to refer to a given tag.
// But that's not all! It's possible to refer to a tag through a derived tag even if it's actually defined in the base tag.
auto end = std::remove_if(missing_tags.begin(), missing_tags.end(), std::bind(&reference::match, _1, std::cref(defined_tag_paths_)));
missing_tags.erase(std::remove_if(missing_tags.begin(), end, std::bind(&schema_self_validator::tag_path_exists, this, std::ref(cfg), _1)), missing_tags.end());
auto end = std::remove_if(missing_tags.begin(), missing_tags.end(), std::bind(&reference::match, std::placeholders::_1, std::cref(defined_tag_paths_)));
missing_tags.erase(std::remove_if(missing_tags.begin(), end, std::bind(&schema_self_validator::tag_path_exists, this, std::ref(cfg), std::placeholders::_1)), missing_tags.end());
std::sort(missing_types.begin(), missing_types.end());
std::sort(missing_tags.begin(), missing_tags.end());
static const config dummy;

View file

@ -426,7 +426,7 @@ std::ostream& operator<<(std::ostream& o, const server::request& r)
void server::handle_new_client(socket_ptr socket)
{
async_receive_doc(socket,
std::bind(&server::handle_request, this, _1, _2)
std::bind(&server::handle_request, this, std::placeholders::_1, std::placeholders::_2)
);
}
@ -590,7 +590,7 @@ void server::handle_sighup(const boost::system::error_code&, int)
LOG_CS << "Reloaded configuration\n";
sighup_.async_wait(std::bind(&server::handle_sighup, this, _1, _2));
sighup_.async_wait(std::bind(&server::handle_sighup, this, std::placeholders::_1, std::placeholders::_2));
}
#endif
@ -598,7 +598,7 @@ void server::handle_sighup(const boost::system::error_code&, int)
void server::flush_cfg()
{
flush_timer_.expires_from_now(std::chrono::minutes(10));
flush_timer_.async_wait(std::bind(&server::handle_flush, this, _1));
flush_timer_.async_wait(std::bind(&server::handle_flush, this, std::placeholders::_1));
}
void server::handle_flush(const boost::system::error_code& error)
@ -712,7 +712,7 @@ void server::send_message(const std::string& msg, socket_ptr sock)
const auto& escaped_msg = simple_wml_escape(msg);
simple_wml::document doc;
doc.root().add_child("message").set_attr_dup("message", escaped_msg.c_str());
async_send_doc(sock, doc, std::bind(&server::handle_new_client, this, _1), null_handler);
async_send_doc(sock, doc, std::bind(&server::handle_new_client, this, std::placeholders::_1), null_handler);
}
void server::send_error(const std::string& msg, socket_ptr sock)
@ -721,7 +721,7 @@ void server::send_error(const std::string& msg, socket_ptr sock)
const auto& escaped_msg = simple_wml_escape(msg);
simple_wml::document doc;
doc.root().add_child("error").set_attr_dup("message", escaped_msg.c_str());
async_send_doc(sock, doc, std::bind(&server::handle_new_client, this, _1), null_handler);
async_send_doc(sock, doc, std::bind(&server::handle_new_client, this, std::placeholders::_1), null_handler);
}
void server::send_error(const std::string& msg, const std::string& extra_data, unsigned int status_code, socket_ptr sock)
@ -742,7 +742,7 @@ void server::send_error(const std::string& msg, const std::string& extra_data, u
err_cfg.set_attr_dup("extra_data", escaped_extra_data.c_str());
err_cfg.set_attr_dup("status_code", escaped_status_str.c_str());
async_send_doc(sock, doc, std::bind(&server::handle_new_client, this, _1), null_handler);
async_send_doc(sock, doc, std::bind(&server::handle_new_client, this, std::placeholders::_1), null_handler);
}
config& server::get_addon(const std::string& id)
@ -896,7 +896,7 @@ void server::handle_request_campaign_list(const server::request& req)
simple_wml::document doc(wml.c_str(), simple_wml::INIT_STATIC);
doc.compress();
async_send_doc(req.sock, doc, std::bind(&server::handle_new_client, this, _1));
async_send_doc(req.sock, doc, std::bind(&server::handle_new_client, this, std::placeholders::_1));
}
void server::handle_request_campaign(const server::request& req)
@ -999,7 +999,7 @@ void server::handle_request_campaign(const server::request& req)
LOG_CS << req << "Sending add-on '" << name << "' version: " << from << " -> " << to << " (delta))\n";
async_send_doc(req.sock, doc, std::bind(&server::handle_new_client, this, _1), null_handler);
async_send_doc(req.sock, doc, std::bind(&server::handle_new_client, this, std::placeholders::_1), null_handler);
full_pack_path.clear();
}
@ -1015,7 +1015,7 @@ void server::handle_request_campaign(const server::request& req)
}
LOG_CS << req << "Sending add-on '" << name << "' version: " << to << " size: " << full_pack_size / 1024 << " KiB\n";
async_send_file(req.sock, full_pack_path, std::bind(&server::handle_new_client, this, _1), null_handler);
async_send_file(req.sock, full_pack_path, std::bind(&server::handle_new_client, this, std::placeholders::_1), null_handler);
}
// Clients doing upgrades or some other specific thing shouldn't bump
@ -1067,7 +1067,7 @@ void server::handle_request_campaign_hash(const server::request& req)
}
LOG_CS << req << "Sending add-on hash index for '" << req.cfg["name"] << "' size: " << file_size / 1024 << " KiB\n";
async_send_file(req.sock, path, std::bind(&server::handle_new_client, this, _1), null_handler);
async_send_file(req.sock, path, std::bind(&server::handle_new_client, this, std::placeholders::_1), null_handler);
}
}

View file

@ -74,7 +74,7 @@ void server_base::start_server()
[=](const boost::system::error_code& error, int sig)
{ this->handle_sighup(error, sig); });
#endif
sigs_.async_wait(std::bind(&server_base::handle_termination, this, _1, _2));
sigs_.async_wait(std::bind(&server_base::handle_termination, this, std::placeholders::_1, std::placeholders::_2));
}
void server_base::serve(boost::asio::ip::tcp::acceptor& acceptor)
@ -119,7 +119,7 @@ void server_base::serverside_handshake(socket_ptr socket)
boost::shared_array<char> handshake(new char[4]);
async_read(
*socket, boost::asio::buffer(handshake.get(), 4),
std::bind(&server_base::handle_handshake, this, _1, socket, handshake)
std::bind(&server_base::handle_handshake, this, std::placeholders::_1, socket, handshake)
);
}

View file

@ -652,7 +652,7 @@ static lg::log_domain log_server("server");
out << *groups.begin();
std::ostream& (*fn)(std::ostream&,const std::string&) = &std::operator<<;
std::for_each( ++groups.begin(), groups.end(), std::bind(fn,std::bind(fn,std::ref(out),std::string(", ")),_1));
std::for_each( ++groups.begin(), groups.end(), std::bind(fn,std::bind(fn,std::ref(out),std::string(", ")),std::placeholders::_1));
}
}

View file

@ -289,7 +289,7 @@ void server::handle_sighup(const boost::system::error_code& error, int)
cfg_ = read_config();
load_config();
sighup_.async_wait(std::bind(&server::handle_sighup, this, _1, _2));
sighup_.async_wait(std::bind(&server::handle_sighup, this, std::placeholders::_1, std::placeholders::_2));
}
#endif
@ -302,7 +302,7 @@ void server::handle_graceful_timeout(const boost::system::error_code& error)
throw server_shutdown("graceful shutdown timeout");
} else {
timer_.expires_from_now(std::chrono::seconds(1));
timer_.async_wait(std::bind(&server::handle_graceful_timeout, this, _1));
timer_.async_wait(std::bind(&server::handle_graceful_timeout, this, std::placeholders::_1));
}
}
@ -607,12 +607,12 @@ void server::refresh_tournaments(const boost::system::error_code& ec)
void server::handle_new_client(socket_ptr socket)
{
async_send_doc(socket, version_query_response_, std::bind(&server::handle_version, this, _1));
async_send_doc(socket, version_query_response_, std::bind(&server::handle_version, this, std::placeholders::_1));
}
void server::handle_version(socket_ptr socket)
{
async_receive_doc(socket, std::bind(&server::read_version, this, _1, _2));
async_receive_doc(socket, std::bind(&server::read_version, this, std::placeholders::_1, std::placeholders::_2));
}
void server::read_version(socket_ptr socket, std::shared_ptr<simple_wml::document> doc)
@ -626,12 +626,12 @@ void server::read_version(socket_ptr socket, std::shared_ptr<simple_wml::documen
// Check if it is an accepted version.
auto accepted_it = std::find_if(accepted_versions_.begin(), accepted_versions_.end(),
std::bind(&utils::wildcard_string_match, version_str, _1));
std::bind(&utils::wildcard_string_match, version_str, std::placeholders::_1));
if(accepted_it != accepted_versions_.end()) {
LOG_SERVER << client_address(socket) << "\tplayer joined using accepted version " << version_str
<< ":\ttelling them to log in.\n";
async_send_doc(socket, login_response_, std::bind(&server::login, this, _1, version_str, source_str));
async_send_doc(socket, login_response_, std::bind(&server::login, this, std::placeholders::_1, version_str, source_str));
return;
}
@ -670,7 +670,7 @@ void server::read_version(socket_ptr socket, std::shared_ptr<simple_wml::documen
void server::login(socket_ptr socket, std::string version, std::string source)
{
async_receive_doc(socket, std::bind(&server::handle_login, this, _1, _2, version, source));
async_receive_doc(socket, std::bind(&server::handle_login, this, std::placeholders::_1, std::placeholders::_2, version, source));
}
void server::handle_login(socket_ptr socket, std::shared_ptr<simple_wml::document> doc, std::string version, std::string source)
@ -1006,7 +1006,7 @@ void server::send_password_request(socket_ptr socket,
e.set_attr("error_code", error_code);
}
async_send_doc(socket, doc, std::bind(&server::login, this, _1, version, source));
async_send_doc(socket, doc, std::bind(&server::login, this, std::placeholders::_1, version, source));
}
void server::add_player(socket_ptr socket, const wesnothd::player& player)
@ -1043,8 +1043,8 @@ void server::add_player(socket_ptr socket, const wesnothd::player& player)
void server::read_from_player(socket_ptr socket)
{
async_receive_doc(socket,
std::bind(&server::handle_read_from_player, this, _1, _2),
std::bind(&server::remove_player, this, _1)
std::bind(&server::handle_read_from_player, this, std::placeholders::_1, std::placeholders::_2),
std::bind(&server::remove_player, this, std::placeholders::_1)
);
}
@ -1292,7 +1292,7 @@ void server::handle_create_game(socket_ptr socket, simple_wml::node& create_game
}
player_connections_.modify(
player_connections_.find(socket), std::bind(&server::create_game, this, _1, std::ref(create_game)));
player_connections_.find(socket), std::bind(&server::create_game, this, std::placeholders::_1, std::ref(create_game)));
return;
}
@ -1310,7 +1310,7 @@ void server::create_game(player_record& host_record, simple_wml::node& create_ga
// and set the player as the host/owner.
host_record.get_game().reset(
new wesnothd::game(player_connections_, host_record.socket(), game_name, save_replays_, replay_save_path_),
std::bind(&server::cleanup_game, this, _1)
std::bind(&server::cleanup_game, this, std::placeholders::_1)
);
wesnothd::game& g = *host_record.get_game();
@ -1422,7 +1422,7 @@ void server::handle_join_game(socket_ptr socket, simple_wml::node& join)
}
player_connections_.modify(player_connections_.find(socket),
std::bind(&player_record::set_game, _1, player_connections_.get<game_t>().find(game_id)->get_game()));
std::bind(&player_record::set_game, std::placeholders::_1, player_connections_.get<game_t>().find(game_id)->get_game()));
g->describe_slots();
@ -1689,7 +1689,7 @@ void server::handle_player_in_game(socket_ptr socket, std::shared_ptr<simple_wml
} else {
auto description = g.description();
player_connections_.modify(player_connections_.find(socket), std::bind(&player_record::enter_lobby, _1));
player_connections_.modify(player_connections_.find(socket), std::bind(&player_record::enter_lobby, std::placeholders::_1));
if(!g_ptr.expired()) {
g.describe_slots();
}
@ -1766,7 +1766,7 @@ void server::handle_player_in_game(socket_ptr socket, std::shared_ptr<simple_wml
: g.kick_member(*data.child("kick"), socket));
if(user) {
player_connections_.modify(player_connections_.find(user), std::bind(&player_record::enter_lobby, _1));
player_connections_.modify(player_connections_.find(user), std::bind(&player_record::enter_lobby, std::placeholders::_1));
if(g.describe_slots()) {
update_game_in_lobby(g, user);
}
@ -2025,7 +2025,7 @@ void server::shut_down_handler(
acceptor_v4_.close();
timer_.expires_from_now(std::chrono::seconds(10));
timer_.async_wait(std::bind(&server::handle_graceful_timeout, this, _1));
timer_.async_wait(std::bind(&server::handle_graceful_timeout, this, std::placeholders::_1));
process_command(
"msg The server is shutting down. You may finish your games but can't start new ones. Once all "
@ -2056,7 +2056,7 @@ void server::restart_handler(const std::string& issuer_name,
acceptor_v6_.close();
acceptor_v4_.close();
timer_.expires_from_now(std::chrono::seconds(10));
timer_.async_wait(std::bind(&server::handle_graceful_timeout, this, _1));
timer_.async_wait(std::bind(&server::handle_graceful_timeout, this, std::placeholders::_1));
start_new_server();
@ -2894,7 +2894,7 @@ void server::delete_game(int gameid, const std::string& reason)
// This will call cleanup_game() deleter since there won't
// be any references to that game from player_connections_ anymore
for(const auto& it : range_vctor) {
player_connections_.get<game_t>().modify(it, std::bind(&player_record::enter_lobby, _1));
player_connections_.get<game_t>().modify(it, std::bind(&player_record::enter_lobby, std::placeholders::_1));
}
// send users in the game a notification to leave the game since it has ended

View file

@ -71,7 +71,7 @@ wesnothd_connection::wesnothd_connection(const std::string& host, const std::str
{
MPTEST_LOG;
resolver_.async_resolve(boost::asio::ip::tcp::resolver::query(host, service),
std::bind(&wesnothd_connection::handle_resolve, this, _1, _2));
std::bind(&wesnothd_connection::handle_resolve, this, std::placeholders::_1, std::placeholders::_2));
// Starts the worker thread. Do this *after* the above async_resolve call or it will just exit immediately!
worker_thread_ = std::thread([this]() {
@ -117,7 +117,7 @@ void wesnothd_connection::handle_resolve(const error_code& ec, resolver::iterato
void wesnothd_connection::connect(resolver::iterator iterator)
{
MPTEST_LOG;
socket_.async_connect(*iterator, std::bind(&wesnothd_connection::handle_connect, this, _1, iterator));
socket_.async_connect(*iterator, std::bind(&wesnothd_connection::handle_connect, this, std::placeholders::_1, iterator));
LOG_NW << "Connecting to " << iterator->endpoint().address() << '\n';
}
@ -151,7 +151,7 @@ void wesnothd_connection::handshake()
[](const error_code& ec, std::size_t) { if(ec) { throw system_error(ec); } });
boost::asio::async_read(socket_, boost::asio::buffer(&handshake_response_.binary, 4),
std::bind(&wesnothd_connection::handle_handshake, this, _1));
std::bind(&wesnothd_connection::handle_handshake, this, std::placeholders::_1));
}
// worker thread
@ -384,8 +384,8 @@ void wesnothd_connection::send()
bufs.push_front(boost::asio::buffer(reinterpret_cast<const char*>(&payload_size_), 4));
boost::asio::async_write(socket_, bufs,
std::bind(&wesnothd_connection::is_write_complete, this, _1, _2),
std::bind(&wesnothd_connection::handle_write, this, _1, _2));
std::bind(&wesnothd_connection::is_write_complete, this, std::placeholders::_1, std::placeholders::_2),
std::bind(&wesnothd_connection::handle_write, this, std::placeholders::_1, std::placeholders::_2));
}
// worker thread
@ -394,8 +394,8 @@ void wesnothd_connection::recv()
MPTEST_LOG;
boost::asio::async_read(socket_, read_buf_,
std::bind(&wesnothd_connection::is_read_complete, this, _1, _2),
std::bind(&wesnothd_connection::handle_read, this, _1, _2));
std::bind(&wesnothd_connection::is_read_complete, this, std::placeholders::_1, std::placeholders::_2),
std::bind(&wesnothd_connection::handle_read, this, std::placeholders::_1, std::placeholders::_2));
}
// main thread