Boost logo

Boost :

From: Ed Brey (brey_at_[hidden])
Date: 2000-02-15 09:51:24


From: "Aleksey Gurtovoy" <alexy_at_[hidden]>
> Here it is. Or, rather, here they are ;) - 'scoped_value' and
> 'deffered_value' classes. The second one is an implementation of Dave's
> 'set_on_exit' class, but (as you see :) I gave it another name. Of course,
a
> need for this class and especially the name itself is a big discussion
> point. But *I* feel both of them will be useful - each in its own way.

IHMO, this looks very good, indeed good enough for detailed review and
comments:

1. I really like two class breakdown and the names of the classes, except
check the spelling of deferred.

2. Check the detail namespace. IIRC, we decided on "detail" rather than
"details".

3. The "::boost::" in "::boost::details::" seems unnecessary. Any reason
this the lookup would ever go awry using the terse form?

4. Any reason that auto_restore doesn't inherit from noncopyable instead of
the derived classes? It would simplify the code a notch. One could argue
that you lose documentation, but that seems to be a weak argument since the
user shouldn't be looking at private base class specifications (or private
anything) for documentation. The html docs should state the copy
capabilities of the public classes.

5. I think you may need "typename" on the "const T value_" and "T&
variable_", and maybe the typedefs too. I've never been able to figure out
what the requirements are. Does anyone know of a good (easily
understandable) reference for learning where typename is required?


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