Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dangerous usage of std::forward #864

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions core/include/traccc/edm/details/host_container.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,8 @@ class host_container : public container_base<header_t, item_t, vecmem::vector,
*/
template <typename h_prime, typename v_prime>
TRACCC_HOST void push_back(h_prime&& new_header, v_prime&& new_items) {
this->m_headers.push_back(
std::forward<typename base_type::header_type>(new_header));
this->m_items.push_back(
std::forward<typename base_type::item_vector::value_type>(
new_items));
this->m_headers.push_back(std::forward<h_prime>(new_header));
this->m_items.push_back(std::forward<v_prime>(new_items));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions performance/src/efficiency/nseed_performance_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ nseed_performance_writer::nseed_performance_writer(
const std::string& prefix, std::unique_ptr<track_filter>&& filter,
std::unique_ptr<track_matcher>&& matcher)
: _prefix(prefix),
_filter(std::forward<std::unique_ptr<track_filter>>(filter)),
_matcher(std::forward<std::unique_ptr<track_matcher>>(matcher)) {}
_filter(std::move(filter)),
_matcher(std::move(matcher)) {}

void nseed_performance_writer::initialize() {
output_seed_file.open(_prefix + "seeds.csv");
Expand Down
Loading