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 for loop copy warning #2001

Merged
merged 1 commit into from
Jan 25, 2025
Merged

Conversation

jmackay2
Copy link
Contributor

This fixes a warning seen building on Ubuntu 24.04.

Warning:

gtsam/gtsam/discrete/Assignment.h:93:21: error: loop variable ‘<structured bindings>’ creates a copy from type ‘const std::pair<long unsigned int, long unsigned int>’ [-Werror=range-loop-construct]
   93 |     for (const auto [idx, _] : keys) assignment[idx] = 0;  // Initialize from 0

This change uses a reference to avoid the copy.

@dellaert dellaert merged commit 82731b8 into borglab:develop Jan 25, 2025
35 checks passed
@jmackay2 jmackay2 deleted the fix_copy_warning branch January 25, 2025 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants