Topic: Question about exception specifications


Author: Michael Greenberg <mgreenberg@scr.siemens.com>
Date: 1998/10/27
Raw View
My understanding of exception specifications is that they act as if they
are part of the type of an object.  For example (from section 15.4)

void (*fi)() throw(int) ;
void (*ff)() throw(float, double) ;
void f() throw (float) ;

fi = ff;  // not allowed.
ff = f; // OK

I have no problem with that.

My question is why can't an exception specification appear in a typedef?

Is there some reason that the specification is not considered to be part
of a type?
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]





Author: herbs@cntc.com (Herb Sutter)
Date: 1998/10/27
Raw View
On 27 Oct 98 14:17:40 GMT, Michael Greenberg
<mgreenberg@scr.siemens.com> wrote:
>My understanding of exception specifications is that they act as if they
>are part of the type of an object.
[...]
>Is there some reason that the specification is not considered to be part
>of a type?

Both your statement are correct: the exception spec acts in many cases
as thought it were part of the type, but it is not officially blessed
as part of the type.

The answer to your question is: "Because." :) This issue is being
actively discussed in the Core working group, and got serious
attention at the Santa Cruz meeting earlier this month. My impression
is that it's "likely" this will be officially changed/corrected
sometime in the next few years, as long as no fatal objections are
raised (there could be quite a bit of impact on the Library working
group, for one thing). And, yes, that's fast... as Bill Plauger so
eloquently put it, 'Nothing in ISO takes less than two years. If you
were to scream "FIRE!" in a crowded ISO meeting, it would take two
years for people to get through the doors.' Note that it's set up this
way deliberately, to help prevent people from rushing things through
thoughtlessly and destabilizing the standard.

Herb

---
Herb Sutter (mailto:herbs@cntc.com)

Current Network Technologies Corp  2695 North Sheridan Way, Suite 150
www.cntc.com www.peerdirect.com    Mississauga Ontario Canada L5K 2N6
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]