D - throw
- Pavel Minayev (2/2) Mar 13 2002 Why doesn't D allow throw statement without arguments? In C++ it rethrow...
- Walter (3/5) Mar 12 2002 I just didn't think that added much of anything.
- Pavel Minayev (13/14) Mar 13 2002 Why? A very convenient feature. Besides, it allows to omit argument name
- Russ Lewis (16/30) Mar 13 2002 It's also useful for reporting errors of unrecognized exceptions:
- Walter (8/36) Mar 13 2002 Just use:
- Pavel Minayev (5/11) Mar 13 2002 Yes, I remember that only objects can be thrown in D.
Why doesn't D allow throw statement without arguments? In C++ it rethrows the exception being processed, what's bad in it?
Mar 13 2002
"Pavel Minayev" <evilone omen.ru> wrote in message news:a6mlkb$1ada$1 digitaldaemon.com...Why doesn't D allow throw statement without arguments? In C++ it rethrows the exception being processed, what's bad in it?I just didn't think that added much of anything.
Mar 12 2002
"Walter" <walter digitalmars.com> wrote in message news:a6n1po$1fp3$1 digitaldaemon.com...I just didn't think that added much of anything.Why? A very convenient feature. Besides, it allows to omit argument name in catch blocks: try { ... } catch (OutOfMemory) { // do something useful here throw; }
Mar 13 2002
Pavel Minayev wrote:"Walter" <walter digitalmars.com> wrote in message news:a6n1po$1fp3$1 digitaldaemon.com...It's also useful for reporting errors of unrecognized exceptions: try { ... } catch(...) { printf("error in myfunc(): "); throw; }; -- The Villagers are Online! villagersonline.com .[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ] .[ (a version.of(English).(precise.more)) is(possible) ] ?[ you want.to(help(develop(it))) ]I just didn't think that added much of anything.Why? A very convenient feature. Besides, it allows to omit argument name in catch blocks: try { ... } catch (OutOfMemory) { // do something useful here throw; }
Mar 13 2002
"Russ Lewis" <spamhole-2001-07-16 deming-os.org> wrote in message news:3C8F83A7.6B5C1214 deming-os.org...Pavel Minayev wrote:Just use: catch(Object o) { ... throw o; }"Walter" <walter digitalmars.com> wrote in message news:a6n1po$1fp3$1 digitaldaemon.com...It's also useful for reporting errors of unrecognized exceptions: try { ... } catch(...) { printf("error in myfunc(): "); throw; };I just didn't think that added much of anything.Why? A very convenient feature. Besides, it allows to omit argument name in catch blocks: try { ... } catch (OutOfMemory) { // do something useful here throw; }
Mar 13 2002
"Walter" <walter digitalmars.com> wrote in message news:a6o83v$208d$1 digitaldaemon.com...Just use: catch(Object o) { ... throw o; }Yes, I remember that only objects can be thrown in D. Yet, "throw;" seems to be a convenient feature to me. Something that can be accomplished by other means, but just makes your life a bit easier.
Mar 13 2002