Skip to content

Conversation

@joto
Copy link
Collaborator

@joto joto commented May 31, 2025

See individual commits

joto added 2 commits May 31, 2025 09:33
And reorder class members in one case to make the memory footprint
smaller.
This was a useful trick back in the days, but in C++17 it is not needed
any more. The constexpr expression is more clear in its intent.

See for instance here:
https://stackoverflow.com/questions/37259807/static-constexpr-int-vs-old-fashioned-enum-when-and-why
@lonvia
Copy link
Collaborator

lonvia commented Jun 1, 2025

I like going away from the awkward enum constructs. Should we go back to using upper case for constants with constexpr? It's not exactly C++ coding style but being able to make out constants seems useful.

@joto
Copy link
Collaborator Author

joto commented Jun 1, 2025

Should we go back to using upper case for constants with constexpr?

Agree. There are quite some more though. I'll do an extra PR.

@lonvia lonvia merged commit 812ba2f into osm2pgsql-dev:master Jun 1, 2025
24 checks passed
@joto joto deleted the enum-refactor branch June 10, 2025 08:51
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