[RFA v2 10/24] Remove make_cleanup_restore_current_language

Simon Marchi simon.marchi@polymtl.ca
Tue Aug 1 08:44:00 GMT 2017


On 2017-08-01 00:17, Tom Tromey wrote:
> Simon> 2. should only only save and restore the current language, and
> Simon> not set the new language.
> 
> scoped_restore allows setting the new value.  That's what I was copying
> here.  From scoped_restore.h:
> 
>   /* Create a new scoped_restore object that saves the current value
>      of *VAR, and sets *VAR to VALUE.  *VAR will be restored when this
>      scoped_restore object is destroyed.  This is templated on T2 to
>      allow passing VALUEs of types convertible to T.
>      E.g.: T='base'; T2='derived'.  */
>   template <typename T2>
>   scoped_restore_tmpl (T *var, T2 value)
>     : scoped_restore_base (var),
>       m_saved_value (*var)
>   {
>     *var = value;
>   }
> 
> Tom

I'd argue the same thing for scoped_restore, but if I'm the only one 
bothered by it, I can live with it.

Simon



More information about the Gdb-patches mailing list