Boost logo

Boost :

From: Dave Abrahams (abrahams_at_[hidden])
Date: 1999-06-30 21:51:22


> - Hiding the implementation details for timer provides a bad tradeoff:
> it requires an otherwise unnecessary heap allocation for each instantiation
> of a timer. It would be better to byte the bullet and put clock_t into
> the timer class.

I don't agree that it's particularly bad. Whether it's a good trade-off
depends on the goals of the implementor and users. Perhaps that hiding
should be justified, though.

I do wonder about the following:

1. why it doesn't use one of our lovely smart pointers instead of doing the
management itself.

2. why the implementation is stored as a reference. While the code looks
correct, reference members are a dicey proposition in general, and hard to
get right. I avoid them, and would like boost to set the same example.

3. whether we ought to be including code like the using-directive in
timer.cpp which is designed to work around non-conformant implementations.
(I prefer to have users compile with -Dstd for this case).

Also, I think progress_display might be a bit too general a name. I expected
a (non-textual) GUI element! Perhaps text_progress_display would be better.
You could break out the display independent part into an abstract base
class, so when someone writes the boost GUI we will be able to use reuse it.

-Dave

------------------------------------------------------------------------

eGroups.com home: http://www.egroups.com/group/boost
http://www.egroups.com - Simplifying group communications


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