Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > comp.std.c++ > #788

Amend request (throwing error)

Path csiph.com!feeder.erje.net!2.us.feeder.erje.net!news.ripco.com!news.glorb.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!Xl.tags.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date Fri, 18 Mar 2016 13:20:02 -0500
Return-Path <cppmods@glengoyne.dreamhost.com>
Sender std-cpp-request@vandevoorde.com
Approved austern@google.com
Message-ID <1457761005.3236.4.camel@totalbb.net.tw> (permalink)
Newsgroups comp.std.c++
From WIJ <wij@totalbb.net.tw>
Subject Amend request (throwing error)
Organization unknown
Content-Type text/plain; charset="UTF-8"
X-Original-Date Sat, 12 Mar 2016 13:36:45 +0800
X-Submission-Address std-cpp-submit@vandevoorde.com
Date Fri, 18 Mar 2016 13:13:20 CST
Lines 37
X-Usenet-Provider http://www.giganews.com
X-Trace sv3-gftQm/+2j1PCrep4mXI0hqOmBrRGsK8bfOyUPGrDA225ob+FTwzEfEoObgBHp27b3PUaVKxsKciH4hP!Jdvjy6rpISHKVuAQLuNVYT+e8fzd6ULWUsXjX2Fws5oHH29Qpwdrlza/0gQBx+9U7Og=
X-Complaints-To abuse@giganews.com
X-DMCA-Notifications http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 2470
X-Received-Bytes 2582
X-Received-Body-CRC 2722181941
Xref csiph.com comp.std.c++:788

Show key headers only | View raw


The concept and usage of error handling mechanism(throw,catch) should
have now been more widely understood through painful experiences that
it isn't suitable at all for the general programming idea of
'error handling'. For instance:

void f(int v)
{
 if(v<5) throw std::invalid_argument("v<5");
 ...
};

void g() try {
  f(2);
}
catch(std::invalid_argument& e) {
 // 1. The captured e is sensitive to the context, e.g. any functions
 //    used particularly implicit ones, and library linked.
 // 2. No guarantee e is what the programmer expected!
};

The impact is deep in any C++ components using ctor,dtor or operator=,
..,etc, involving implicit conversions. Since the globally practical
function of the standard is educational. Text books and derivatives
have to be written on documents published by the standard committee or
C++ authorities. People writting documents feels difficult addressing
it differently. Please consider removing such 'error handling' suggest
and add some warning addressing or amend this issue.



--
[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]

Back to comp.std.c++ | Previous | Next | Find similar


Thread

Amend request (throwing error) WIJ <wij@totalbb.net.tw> - 2016-03-18 13:13 -0600

csiph-web