Skip to content

Commit

Permalink
Fix lambda capture
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Dec 10, 2024
1 parent 1198569 commit cfc855f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions gpio_controllers/src/gpio_command_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,23 +160,29 @@ bool GpioCommandController::update_dynamic_map_parameters()

void GpioCommandController::store_command_interface_types()
{
for (const auto & [gpio_name, interfaces] : params_.command_interfaces.gpios_map)
for (const auto & entry : params_.command_interfaces.gpios_map)
{
const auto & gpio_name = entry.first;
const auto & interfaces = entry.second;

std::transform(
interfaces.interfaces.cbegin(), interfaces.interfaces.cend(),
std::back_inserter(command_interface_types_),
[&](const auto & interface_name) { return gpio_name + "/" + interface_name; });
[gpio_name](const auto & interface_name) { return gpio_name + "/" + interface_name; });
}
}

void GpioCommandController::store_state_interface_types()
{
for (const auto & [gpio_name, interfaces] : params_.state_interfaces.gpios_map)
for (const auto & entry : params_.command_interfaces.gpios_map)
{
const auto & gpio_name = entry.first;
const auto & interfaces = entry.second;

std::transform(
interfaces.interfaces.cbegin(), interfaces.interfaces.cend(),
std::back_inserter(state_interface_types_),
[&](const auto & interface_name) { return gpio_name + "/" + interface_name; });
[gpio_name](const auto & interface_name) { return gpio_name + "/" + interface_name; });
}
}

Expand Down

0 comments on commit cfc855f

Please sign in to comment.