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

Add warning if bit::Register() has not used save() #1413

Open
kammce opened this issue Dec 8, 2020 · 0 comments
Open

Add warning if bit::Register() has not used save() #1413

kammce opened this issue Dec 8, 2020 · 0 comments
Labels
Utility utility classes and functions

Comments

@kammce
Copy link
Member

kammce commented Dec 8, 2020

Feature Request

A common error that programmers can make when using bit::Register() is forgetting to execute the .Save() function at the end. There are two ways to solve this. Have the destructor of the object save contents or simply warn the developer that the contents have not been saved to anything. The second gives some flexibility and is less opaque to the developer. Potentially the first option of save on destruction can be performed with a bit::AutoSaveRegister, but that can be made another time.

Detailed Description

Can utilize the [[nodiscard("The register's contents have not yet been saved")]]

@kammce kammce added the Utility utility classes and functions label Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Utility utility classes and functions
Projects
None yet
Development

No branches or pull requests

1 participant