3 ms·
Not in C++ I believe ?
by jcelerier 5y ago
Not in C++ I believe ?
- foldr 5y agoThe C++ standard IO library doesn't enable exceptions by default, but IIRC that's just a relic of the fact that it dates back to when C++ didn't have exceptions.
- mpyne 5y agoIt's library dependent. iostreams (part of C++ std lib) doesn't throw exceptions by default but I believe it can be configured to throw if you want.
- TheMonarchist 5y agohttps://en.cppreference.com/w/cpp/io/basic_ios/exceptions https://en.cppreference.com/w/cpp/io/basic_ios/exceptions
- jcelerier 5y agoDamn, in all those years I've absolutely never come across this, thanks
- YATA0 5y agoThat is manually throwing an exception if the file doesn't exist. C++ stdlib does not throw an exception if a file does not exist. I agree with this philosophy because files not existing isn't an exceptional case.