diff --git a/tlm_teamd/teamdctl_mgr.cpp b/tlm_teamd/teamdctl_mgr.cpp index 09ef8c109d1a..3ea374c797d4 100644 --- a/tlm_teamd/teamdctl_mgr.cpp +++ b/tlm_teamd/teamdctl_mgr.cpp @@ -145,8 +145,8 @@ bool TeamdCtlMgr::remove_lag(const std::string & lag_name) void TeamdCtlMgr::process_add_queue() { std::vector lag_names_to_add; - std::transform(m_lags_to_add.begin(), m_lags_to_add.end(), lag_names_to_add.begin(), [](auto pair) { return pair.first; }); - for (const auto lag_name: lag_names_to_add) + std::transform(m_lags_to_add.begin(), m_lags_to_add.end(), std::back_inserter(lag_names_to_add), [](const auto & pair) { return pair.first; }); + for (const auto & lag_name: lag_names_to_add) { bool result = try_add_lag(lag_name); if (!result)