- asserts considered harmful - 1 Update
- C++ exceptions are broken. - 1 Update
woodbrian77@gmail.com: Mar 09 11:32AM -0800 On Tuesday, February 23, 2016 at 6:34:16 PM UTC-6, Ian Collins wrote: > > from it from C++. > I think you lost the way somewhere. std::logic_error has its place, but > that place isn't as a substitute for assert. What place is left for std::logic_error? I've never used it and only know of one guy that has: http://stackoverflow.com/questions/2924058/confused-about-stdruntime-error-vs-stdlogic-error/6476858 He (Vladimir) said he was thinking about stopping using it a few years ago. Brian Ebenezer Enterprises - In G-d we trust. http://webEbenezer.net |
"James K. Lowden" <jklowden@speakeasy.net>: Mar 09 08:25AM -0600 On Tue, 8 Mar 2016 06:31:12 CST > As it currently stands a more serious std::logic_error exception can > be downgraded into a less serious std::runtime_error exception if an > exception is thrown whilst evaluating the throw expression. Could you be more specific, please? logic_error is mentioned in my copy of the C++ only in section 19.2.1 (per the index), and I don't find any mention of "downgrading". I also don't understand how it *could* happen, since the compiler generates exception-handling instructions, and the language per se doesn't define logic_error. Why do you say logic_error is "more serious" than runtime_error? Semantically that's not true, insofar as seriousness is not defined by the library. I guess you mean that -- assuming they're used as intended -- a logic error could have been avoided by the programmer, whereas a runtime error could not. Depending on the situation, though, either one can leave the user high and dry. --jkl -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment