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