Give options a designated initializer to make crossreferencing their usage easier - #905
Conversation
|
Can't break MSVC, I've seen plenty of people using that. |
|
Shall I add a CI step for MSVC then? Then I could move to the other approach with confidence |
|
That would be appreciated of course! Apparently it'll produce a billion warnings though. People occasionally submit fixes to make MSVC work again so the current state may not even compile. |
|
Can't be that many people on MSVC because it appears to have been broken for the last 17 months :P CI is so very slow, PR coming assuming it succeeds. |
Yess yessss let's continue supporting the worst compiler toolchain :smiling_imp: Fell out of the changes in #905 CI changes were claude because I cannot be arsed with yaml. Can explain the individual code fixes if ya want any more context. --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
998d891 to
14042cf
Compare
|
So, this now works but I was considering yet another useless refactor: ditch the enum, turn the thing into a packed struct, and expose that for people who want to iterate it as a That would require a larger change, that being changing the overlay code to accept string_view instead of just const char*, but I think it's doable since imgui itself uses start/end of a string and does not need the NUL terminator. |
|
Sounds good to me. This is one of the worst parts in this code base so any improvement is welcome |
|
Changed my mind; the options parsing also creates a vector where order is important and indexed via the enum. This is fine for now. |
Description of change
This always bothered me, you have a commandline arg and it's a massive pain in the ass to work out where it's used because the flag never really matches the enum name.
Array designated initializers are a C99 extension that clang+gcc both support. I suspect msvc still blows up, but are people still using that? I can change it to a std::invoke lambda instead.
Chose to drop the (unused?) option sorting func because, well, unused.
Testing
Builds in CI, didn't do much more intense testing.