Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2000-09-06 09:10:35


> > To paraphrase Scott Meyers, ref<T> is an object that is designed to act,
> > look and feel like the value it holds.
>
> Then why call it 'ref'? Why not call it 'value'?

Because a reference also acts, looks and feels like the object it refers to.
Although 'value' is worth considering.

> > Unfortunately, due to technical constraints, I had to replace r.f() with
> > r->f() and added *r as a companion.
>
> There is some precedent in existing practice (the
> original Great Circle smart pointer library) for
> using an operator() that returns a reference.

You mean r().f()? Is this better than r->f()? r->f() is iterator-compatible
syntax, while r().f() is a nullary function object syntax. I'll have to
think about it.

--
Peter Dimov
Multi Media Ltd.

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