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

Your bubble sort in macro is clever, but… #316

Open
daniel-pfeiffer opened this issue Dec 21, 2024 · 0 comments
Open

Your bubble sort in macro is clever, but… #316

daniel-pfeiffer opened this issue Dec 21, 2024 · 0 comments

Comments

@daniel-pfeiffer
Copy link

it doesn’t solve the problem, which you say was to sort numbers. You took the liberty to reduce that to a tiny subproblem of sorting only digits. I was disappointed, because just now I too need compile time sorting.

You can call const {} and const functions in a macro*). Alas sorting is not const. I’m considering rolling my own, but again mem::swap is not stabilised in const. But with a <T: Copy> generic parameter I can (a, b) = (b, a).

*) I did this recently, implementing a compile time number parser macro mostly as functions.

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

No branches or pull requests

1 participant