Boost logo

Boost :

From: Greg Colvin (gcolvin_at_[hidden])
Date: 2000-02-03 23:04:09


From: Aleksey Gurtovoy <alexy_at_[hidden]>
> ...
> In view of Dave's proposal about some generalization of this class, I think
> 'auto_restore' or 'auto_assign' would be nice names, e.g.
>
> | boost::auto_restore<bool> on_exit( flag, flag );
> | flag = false;
>
> or
>
> | boost::auto_assign<bool> on_exit( flag, flag );
> | flag = false;
>
> But probably there are even better names. The only thing I am sure about is
> that now I don't like 'temporary_value' at all =).
>
> -Alexy
>
> P.S. The more I think the less I like the fact the assignment of a new value
> (with Dave's version of class) takes place on another line. I have some
> vague ideas how to fix it, but they all are too ugly.. Any thoughts?

bool flag = true;
...
{ boost::auto_restore<bool> on_exit( flag, false );
    ...
}


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