This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Will therefore GDB utilize C++ or not?


On Mon, 21 May 2012 18:27:48 +0200, Pedro Alves wrote:
> and then:
> 
>   old_chain = make_cleanup (foo_cleanup, &whatever_arg);
> 
>   if (whatnot)
>     {
>        discard_cleanups (old_chain);
>        return SUCESS;
>     }
>   do_cleanup (old_chain);
> 
> But yes, as I've said before elsewhere, give me destructors,
> everything else I can live without.  :-)
> 
> Basically, whoever understands RAII should understand cleanups.
> Not counting the auto-destruction issue, I'm saying that writing
> raii classes vs writing cleanup function is mostly syntax sugar.

With RAII you do not have to write many times in that function that do_cleanup
statement (for multiple cleanup markers), which makes one of the differences.


Jan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]