Skip to content

🎨 Small refactorings#146

Merged
elbeno merged 1 commit intointel:mainfrom
elbeno:refactorings
Feb 28, 2026
Merged

🎨 Small refactorings#146
elbeno merged 1 commit intointel:mainfrom
elbeno:refactorings

Conversation

@elbeno
Copy link
Contributor

@elbeno elbeno commented Feb 27, 2026

Problems:

  • Handling of field and register names is a bit more complex than needed.
  • read() instantiates mp_list unnecessarily.
  • Using same_as in tests gives a worse error message than using is_same_v when it fails.

Solution:

  • Simply name handling to be more value-based.
  • Don't change tuple to mp_list and back again.
  • Replace same_as with is_same_v in tests.

Note:

  • The same_as change is surprising, but when it fails, is_same_v prints the actual types: same_as just says it failed. To be fair, the error does get out eventually. But both clang and GCC do better and terser with the type trait: https://godbolt.org/z/Koa4sczee

Problems:
- Handling of field and register names is a bit more complex than needed.
- `read()` instantiates `mp_list` unnecessarily.
- Using `same_as` in tests gives a worse error message than using `is_same_v`
  when it fails.

Solution:
- Simply `name` handling to be more value-based.
- Don't change `tuple` to `mp_list` and back again.
- Replace `same_as` with `is_same_v` in tests.

Note:
- The `same_as` change is surprising, but when it fails, `is_same_v` prints the
  actual types: `same_as` just says it failed.
@elbeno elbeno merged commit 23cfdad into intel:main Feb 28, 2026
31 checks passed
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