Boost logo

Boost :

From: Aleksey Gurtovoy (alexy_at_[hidden])
Date: 2000-02-16 00:59:36


Darin Adler <darin_at_[hidden]> wrote:
> I like the idea and the code. Besides things already mentioned by Ed Brey,
I
> have one tiny quibble:
>
> > : inherited( variable, variable ) { variable = new_value; }
>
> The above line can just be replaced by this.
>
> : auto_restore( variable, variable ) { variable = new_value; }
>
> Unless the "inherited" typedef is a workaround for a compiler bug, it
> doesn't improve things in this example. I, for one, think the version
> without it is slightly easier to read.
>

I completely agree with you, Darin. But "inherited" typedef *is* a kind of
workaround - at least for MSVC6.0. Microsoft compiler requires what the name
of a base class in members initialization list was a fully qualified one,
exactly the same as it was listed in the list of base classes. So in our
case we need to write

> : detail::auto_restore<T>( variable, variable ) { variable = new_value; }

or use the 'inherited'.

-Alexy


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk