Re: We have a new standard!

Liste des GroupesRevenir à cl c++ 
Sujet : Re: We have a new standard!
De : wyniijj5 (at) *nospam* gmail.com (wij)
Groupes : comp.lang.c++
Date : 05. Jan 2025, 00:14:44
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <67d0fcdaa9aa19d56b3237d2bf2030bc838ecb5b.camel@gmail.com>
References : 1 2 3 4 5 6 7 8
User-Agent : Evolution 3.54.2 (3.54.2-1.fc41)
On Sat, 2025-01-04 at 20:08 +0200, Paavo Helde wrote:
On 04.01.2025 04:06, Sam wrote:
Paavo Helde writes:
 
 
Anyway, avoiding uncaught exceptions is easy, one just has to place
catch(...) in main() and in all thread functions. Problem solved.
 
Sure, catch(...) deals with it. But it gives you nothing useful to work
with. A valiant attempt to send a bat-signal to std::current_exception
will eke out a few useful bits, if one's lucky, but the end result will
just be more spaghetti code.
 
If an exception has reached the top-level catch, then this means that
all lower levels (which have more knowledge about the context) have not
been able to catch and handle it. In the top-level catch there is little
hope I could do anything smarter, typically I just need to report or log
an error message.
 
So there is no need to differentiate between different types of
exceptions or to extract any useful bits from them, all I need is an
error message. For that I have a little helper function which can be
called from inside catch(...) and which handles various exception base
classes and falls back to typeid(e).name() for unknown types. Actually I
am not interested in exception types at all at this point, not to speak
about enforcing them somehow. If there appear new exception base
classes, I add support for them in the helper function, not trying to
reduce their usage.

This is an interrupt, I didn't read the context of this thread.

std::except was a big blunder (not invented by B.S.). It is similar to 
errno or a global object, you set it up and throw. C++ hide it in a 
beautiful theory called 'advanced error handling'.... long story.

[...]
 
 
I dunno, maybe something like:
 
typedef throws(ClassA, ClassB) AlgoThrownClasses;
 
Then you go ahead and declare your algorithm:
 
void my_algorithm(algorithm_info_t &) throws(AlgoThrownClasses)
 
That's the first good idea from you in this discussion. I still do not
see much point in exception specifications, but such a typedef would at
least make life easier for me on this Alternate Earth.
 
PS. Nowadays they prefer `using` instead of `typedef`.
 
 



Date Sujet#  Auteur
27 Dec 24 * We have a new standard!125Stefan Ram
28 Dec 24 +* Re: We have a new standard!40Sam
28 Dec 24 i+- Re: We have a new standard!1Chris M. Thomasson
28 Dec 24 i`* Re: We have a new standard!38Muttley
28 Dec 24 i +* Re: We have a new standard!26David Brown
29 Dec 24 i i`* Re: We have a new standard!25Muttley
29 Dec 24 i i `* Re: We have a new standard!24David Brown
29 Dec 24 i i  +* Re: We have a new standard!8Muttley
30 Dec 24 i i  i`* Re: We have a new standard!7David Brown
30 Dec 24 i i  i `* Re: We have a new standard!6Muttley
30 Dec 24 i i  i  `* Re: We have a new standard!5David Brown
30 Dec 24 i i  i   `* Re: We have a new standard!4Muttley
31 Dec 24 i i  i    +- Re: We have a new standard!1James Kuyper
1 Jan 25 i i  i    `* Re: We have a new standard!2Michael S
1 Jan 25 i i  i     `- Re: We have a new standard!1Muttley
29 Dec 24 i i  +* Re: We have a new standard!12Paavo Helde
29 Dec 24 i i  i+* Re: We have a new standard!5Michael S
30 Dec 24 i i  ii`* Re: We have a new standard!4Tim Rentsch
30 Dec 24 i i  ii `* Re: We have a new standard!3boltar
30 Dec 24 i i  ii  +- Re: We have a new standard!1David Brown
31 Dec 24 i i  ii  `- Re: We have a new standard!1Tim Rentsch
30 Dec 24 i i  i`* Re: We have a new standard!6Tim Rentsch
30 Dec 24 i i  i +- Re: We have a new standard!1David Brown
31 Dec 24 i i  i `* Re: We have a new standard!4Chris M. Thomasson
31 Dec 24 i i  i  `* Re: We have a new standard!3Tim Rentsch
31 Dec 24 i i  i   `* Re: We have a new standard!2David Brown
31 Dec 24 i i  i    `- Re: We have a new standard!1Chris M. Thomasson
30 Dec 24 i i  `* Re: We have a new standard!3Michael S
30 Dec 24 i i   `* Re: We have a new standard!2David Brown
4 Jan 25 i i    `- Re: We have a new standard!1Michael S
28 Dec 24 i `* Re: We have a new standard!11Phillip
29 Dec 24 i  `* Re: We have a new standard!10Muttley
29 Dec 24 i   `* Re: We have a new standard!9Sam
29 Dec 24 i    +* Re: We have a new standard!4wij
29 Dec 24 i    i`* Re: We have a new standard!3Muttley
29 Dec 24 i    i `* Re: We have a new standard!2wij
29 Dec 24 i    i  `- Re: We have a new standard!1Muttley
29 Dec 24 i    `* Re: We have a new standard!4Muttley
29 Dec 24 i     `* Re: We have a new standard!3Sam
29 Dec 24 i      +- Re: We have a new standard!1Muttley
29 Dec 24 i      `- Re: We have a new standard!1Michael S
28 Dec 24 +* Re: We have a new standard!9Benutzer Eins
28 Dec 24 i`* Re: We have a new standard!8Chris Ahlstrom
28 Dec 24 i +* Re: We have a new standard!6Lynn McGuire
28 Dec 24 i i`* Re: We have a new standard!5Lynn McGuire
29 Dec 24 i i `* Re: We have a new standard!4Chris M. Thomasson
29 Dec 24 i i  `* Re: We have a new standard!3Lynn McGuire
29 Dec 24 i i   +- Re: We have a new standard!1Chris M. Thomasson
29 Dec 24 i i   `- Re: We have a new standard!1Chris M. Thomasson
29 Dec 24 i `- Re: We have a new standard!1David Brown
1 Jan 25 +* Re: We have a new standard!72Michael S
1 Jan 25 i+* Re: We have a new standard!56Muttley
1 Jan 25 ii+- Re: We have a new standard!1Ross Finlayson
2 Jan 25 ii+* Re: We have a new standard!50David Brown
2 Jan 25 iii+* Re: We have a new standard!47Muttley
2 Jan 25 iiii`* Re: We have a new standard!46David Brown
2 Jan 25 iiii +* Re: We have a new standard!42Muttley
2 Jan 25 iiii i`* Re: We have a new standard!41David Brown
2 Jan 25 iiii i +* Re: We have a new standard!10Muttley
2 Jan 25 iiii i i`* Re: We have a new standard!9Keith Thompson
3 Jan 25 iiii i i `* Re: We have a new standard!8Muttley
3 Jan 25 iiii i i  +* Re: We have a new standard!6Keith Thompson
4 Jan 25 iiii i i  i`* Re: We have a new standard!5Muttley
4 Jan 25 iiii i i  i `* Re: We have a new standard!4David Brown
4 Jan 25 iiii i i  i  `* Re: We have a new standard!3Muttley
4 Jan 25 iiii i i  i   `* Re: We have a new standard!2David Brown
4 Jan 25 iiii i i  i    `- Re: We have a new standard!1Muttley
4 Jan 25 iiii i i  `- Re: We have a new standard!1Ross Finlayson
2 Jan 25 iiii i `* Re: We have a new standard!30Sam
3 Jan 25 iiii i  `* Re: We have a new standard!29David Brown
3 Jan 25 iiii i   `* Re: We have a new standard!28Sam
3 Jan 25 iiii i    +* Re: We have a new standard!25Paavo Helde
3 Jan 25 iiii i    i+* Re: We have a new standard!23Sam
3 Jan 25 iiii i    ii+* Re: We have a new standard!5Muttley
3 Jan 25 iiii i    iii`* Re: We have a new standard!4Sam
3 Jan 25 iiii i    iii `* Re: We have a new standard!3Muttley
3 Jan 25 iiii i    iii  `* Re: We have a new standard!2Sam
4 Jan 25 iiii i    iii   `- Re: We have a new standard!1Muttley
3 Jan 25 iiii i    ii+* Re: We have a new standard!4David Brown
3 Jan 25 iiii i    iii`* Re: We have a new standard!3Sam
4 Jan 25 iiii i    iii `* Re: We have a new standard!2David Brown
4 Jan 25 iiii i    iii  `- Re: We have a new standard!1Sam
3 Jan 25 iiii i    ii`* Re: We have a new standard!13Paavo Helde
4 Jan 25 iiii i    ii `* Re: We have a new standard!12Sam
4 Jan 25 iiii i    ii  +- Re: We have a new standard!1Ross Finlayson
4 Jan 25 iiii i    ii  `* Re: We have a new standard!10Paavo Helde
4 Jan 25 iiii i    ii   +- Re: We have a new standard!1Sam
5 Jan 25 iiii i    ii   +- Re: We have a new standard!1wij
6 Jan 25 iiii i    ii   `* Re: We have a new standard!7Muttley
7 Jan 25 iiii i    ii    `* Re: We have a new standard!6Chris Ahlstrom
7 Jan 25 iiii i    ii     +* Re: We have a new standard!4Muttley
8 Jan 25 iiii i    ii     i`* Re: We have a new standard!3Chris Ahlstrom
8 Jan 25 iiii i    ii     i +- Re: We have a new standard!1Keith Thompson
9 Jan 25 iiii i    ii     i `- Re: We have a new standard!1Muttley
8 Jan 25 iiii i    ii     `- Re: We have a new standard!1Sam
4 Jan 25 iiii i    i`- Re: We have a new standard!1Ross Finlayson
3 Jan 25 iiii i    `* Re: We have a new standard!2David Brown
3 Jan 25 iiii i     `- Re: We have a new standard!1Sam
2 Jan 25 iiii `* Re: We have a new standard!3Michael S
2 Jan 25 iiii  `* Re: We have a new standard!2David Brown
2 Jan 25 iiii   `- Re: We have a new standard!1Michael S
2 Jan 25 iii`* Re: We have a new standard!2Keith Thompson
2 Jan 25 ii`* Re: We have a new standard!4Keith Thompson
1 Jan 25 i+* Re: We have a new standard!14Paavo Helde
2 Jan 25 i`- Re: We have a new standard!1Michael S
1 Jan 25 `* Re: We have a new standard!3Rosario19

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal