Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
safety-second
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
3 ms
·
1.
▲
by
safety-second
7y ago
You could use a File class that throws on EOF, but that would be a really bad idea for C++ since throw/catch are very expensive.
2.
▲
by
safety-second
7y ago
C++ exceptions are only good if you use them like signals from C or panics in Go. This means you have to use error values for 99% of errors or you lose this benefit. The fact that the STL sprinkles exceptions everywhere doesn't help th