
30 Nov
2017
30 Nov
'17
6:10 p.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.