1 Dec
2017
1 Dec
'17
2:10 a.m.
Lorenzo Caminiti wrote:
2. How useful is a class like the one above with "crippled" invariants and is_valid() preconditions on all its useful public methods like read()?
A read() member that takes no arguments and returns void is not very realistic. read() can fail, so you can drop its "valid" precondition and just fail when the handle is invalid.