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

📊 Sort spikes. #2433

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

thorstenhater
Copy link
Contributor

Replace custom introsort with std::sort.

deliverable_event_data(cell_local_size_type idx, float w):
cell_local_size_type mech_index = 0; // same as target_handle::mech_index
float weight = 0;
deliverable_event_data(const cell_local_size_type idx, const float w) noexcept:
Copy link
Contributor

@halfflat halfflat Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry (sort-of!) for the drive-by comment without any other engagement on this PR, but it's an almost trivial thing: I think we shouldn't be using const in parameter declarations such as this where it has no semantic value.

The reason is that it clutters the signature and is a bit misleading; having a const there, being unidiomatic, trips up the reader, prompting them to ponder, why are these arguments marked so? Looking at this code, I might be lead to think that cell_local_size_type must be some sort of type alias for a reference type, when of course it isn't.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that's not meant for merging, but rather me being confused about the compiler error (and behaviour)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turned out that newer (like installed on my machine) compilers allow emplace_back for aggregates in C++20 mode, but older ones do not. So, some extra work was needed.

This was referenced Jan 7, 2025
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