Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
atilaneves
· 2y ago · 0 comments
Wouldn't the instance state here be "was constructed"? That is: you should always be able to call `Read` because the constructor opened the file, and you shouldn't have to call `Close` anyway because the destructor did.
Comments
[–]
tonyhb
2y ago
I suppose it depends on the API. Some languages require grabbing a handle and calling open. Either way, theory is the same!