C++11 Lambda FTW!

This commit is contained in:
Robin Gareus 2021-12-24 02:13:50 +01:00
parent cf5dcd12ee
commit 216ff53bb9
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 1 additions and 6 deletions

View File

@ -4105,11 +4105,6 @@ Editor::freeze_route ()
current_interthread_info = 0;
}
static void
set_slot (uint32_t* t, uint32_t v) {
*t = v;
}
void
Editor::bounce_range_selection (BounceTarget target, bool enable_processing)
{
@ -4192,7 +4187,7 @@ Editor::bounce_range_selection (BounceTarget target, bool enable_processing)
for (int c = 0; c < TriggerBox::default_triggers_per_box; ++c) {
// XXX ('A' + x) is not translatable, TODO abstract using nth_letter()
tslot->AddMenuElem (Menu_Helpers::MenuElem (string_compose ("%1", (char)('A' + c)), sigc::bind (sigc::ptr_fun (set_slot), &trigger_slot, c)));
tslot->AddMenuElem (Menu_Helpers::MenuElem (string_compose ("%1", (char)('A' + c)), sigc::bind ([] (uint32_t* t, uint32_t v) {*t = v;}, &trigger_slot, c)));
}
tslot->set_active ("A");