Boost logo

Boost :

From: Dave Gomboc (dave_at_[hidden])
Date: 2003-03-01 03:21:38


> > *laugh* I was thinking exactly the opposite. To me, the resource
> > itself
> > is clear from the template parameter -- it's the management that
> > needs to
> > be indicated.
> >
> > +1 for managed<>.
>
> What template parameter? That's not a part of the name.
> Template parameters, just like function arguments are never
> a part of the name. You do not need to read the header file
> to get the essence. The name itself should indicate the function
> of the class without looking elsewhere.

It does! In this case, the function of the template class is to *manage*,
not to "resource".
 
> managed<>? What is managed? ... answer: take a look at
> the template parameter and you'll see what I mean. I'm
> sorry, that doesn't make sense.

I don't understand what doesn't make sense about it. managed<T> indicates
that T is managed, for whatever T might happen to be. (If you prefer a
noun, manager<T> suffices.) This is analogous to optional<T> or list<T>.
You always have to look at the template parameter to see the type that is
being managed, is considered optional, or that is being held in the list
for any particular instantiation. By contrast, resource<T> doesn't tell
me anything -- T is always a resource, or it wouldn't exist in my program.

Anyway, if (inexplicably to me) this turns out to be a large bone of
contention, it's probably best to drop back to managed_resource<T> (or
resource_manager<T>), which while wordier will be sufficiently obvious to
all concerned.

Dave


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