Fixed non-const lvalue reference to type cannot bind to a temporary of type

This commit is contained in:
ergo720 2021-10-12 18:44:09 +02:00
parent 23c72d825e
commit ca5a1aaa71
1 changed files with 2 additions and 2 deletions

View File

@ -496,7 +496,7 @@ bool Settings::LoadConfig()
continue;
}
auto &lambda = [&control_names, &device](int num_buttons, const char *const ctrl_names[]) {
const auto &lambda = [&control_names, &device](int num_buttons, const char *const ctrl_names[]) {
for (int i = 0; i < num_buttons; i++) {
char control_name[XBOX_BUTTON_NAME_LENGTH];
std::sprintf(control_name, sect_input_profiles.control, ctrl_names[i]);
@ -668,7 +668,7 @@ bool Settings::Save(std::string file_path)
continue;
}
auto &lambda = [&control_names, &device](int num_buttons, const char *const ctrl_names[]) {
const auto &lambda = [&control_names, &device](int num_buttons, const char *const ctrl_names[]) {
for (int i = 0; i < num_buttons; i++) {
char control_name[XBOX_BUTTON_NAME_LENGTH];
std::sprintf(control_name, sect_input_profiles.control, ctrl_names[i]);