"tom_usenet" <tom_usenet@hotmail.com> wrote in message
news:r43krvccm3qhjprh2kdahnc2tf3j0j3pb3@4ax.com...[color=blue]
> On Tue, 18 Nov 2003 21:35:03 +1030, "A" <A@iprimus.com.au> wrote:
>[color=green]
> >Hi,
> >
> >I'm having some difficulty understanding the semantics of the rethrow
> >keyword.[/color]
>
> There is no rethrow keyword. I'm going to assume you mean throw.
>
>
> Consider the following code:[color=green]
> >
> >int main(){
> > try{
> > ...
> > }
> > catch(SomeException &SE){
> > ...
> > }
> > catch(...){
> > rethrow;[/color]
>
> Rather:
> throw;
>[color=green]
> > }
> >return 0;
> >}
> >
> >
> >What is the point of rethrowing the exception caught at catch(...)? Won't
> >this result in a endless cycle effect?[/color]
>
> No, the throw above will just cause the program to terminate (since
> the exception will propogate out of main. throw; is used when you want
> to do a bit of clean up in the current scope, and then let the
> exception propogate up. However, it should be used sparingly - RAII is
> a much better technique to handle exception cleanup.
>
> Tom[/color]
What do you mean by propogate up? what goes up must come down again? and so
it repeats itself.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.538 / Virus Database: 333 - Release Date: 10/11/2003