
Stewart, Robert wrote:
Andrey Semashev wrote:
Perhaps, we could mark the non-throwing overloads as deprecated in the Standard? Like strstreams, they are there but generally throwing overloads are more preferred.
Why is it necessary to impose a single view on the language? Authors often give advice and situations demand certain concessions. Isn't it reasonable to accommodate many use cases? If you're too restrictive, you make C++ less appealing and users will choose other languages. Is that helpful?
I wouldn't say that it would narrow the language in some way. You still get the same functionality, only error reporting mechanism is in question. Using exceptions for this purpose is, well... following the language spirit, so to say, while mandating a dual approach honors code diversity. I happened to support some code that used both exceptions and error codes for error reporting, and I must say it was a pain. I think, at least for educational purposes one form of functions (the throwing one) should be highlighted as preferred.