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")]]
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 abit::AutoSaveRegister
, but that can be made another time.Detailed Description
Can utilize the
[[nodiscard("The register's contents have not yet been saved")]]