Skip to content

Comments

grt: make x/y private in PointT in cugr#8269

Merged
maliberty merged 2 commits intoThe-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:cugr-refactor
Sep 10, 2025
Merged

grt: make x/y private in PointT in cugr#8269
maliberty merged 2 commits intoThe-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:cugr-refactor

Conversation

@openroad-ci
Copy link
Collaborator

No description provided.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2025

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2025

clang-tidy review says "All clean, LGTM! 👍"

Lesson learned the hard way

auto [min_x, max_x] = std::minmax(node->x(), child->x());

if x() returns an int this does not work!  minmax returns a pair of
const int& that then go out of scope leaving min_x/max_x dangling.
Lifetime extension does not apply to the destructed binding.  Gemini
and chatgpt both failed to figure this out without me essentially
explaining it to them (repeatedly).

auto [min_x, max_x] = std::minmax({node->x(), child->x()});

does work as the initializer list form returns a pair of ints which
get copied.  The joys of c++...

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2025

clang-tidy review says "All clean, LGTM! 👍"

@maliberty maliberty merged commit 2ef7fd0 into The-OpenROAD-Project:master Sep 10, 2025
10 of 11 checks passed
@maliberty maliberty deleted the cugr-refactor branch September 10, 2025 04:46
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.

2 participants