----- Original Message -----
From: "Peter Dimov" <[EMAIL PROTECTED]>
To: "Boost mailing list" <[EMAIL PROTECTED]>
Sent: Tuesday, December 10, 2002 3:21 PM
Subject: Re: [boost] Re: Formal review: Optional library


> From: "Fernando Cacciola" <[EMAIL PROTECTED]>
> > I don't know of 'standard' examples, but in my code I do that a lot:
> >
> > class curve
> > {
> >   shared_ptr<polygon> acquire_approx() const { return m_approx ; }
> >   shared_ptr<polygon> m_approx ;
> > } ;
>
> But this is not a get(). It is an acquire_approx(). :-)
>
> I think that most programmers are familiar with get() and would expect the
> returned pointer to be invalidated by the first mutating operation. I
don't
> see what are you trying to achieve with peek().
>
I try to achieve the notion that the returned pointer is invalidated after
the first mutating operation :-)

Are you sure this is interpreted this way by most programmers familiar with
get()?

If you are, and others support your view, I have no problem changing peek()
for get().

I've seen so many people doing nasty things to pointers obtained via get()
that I figured that the name peek() would communicate more strongly that the
object is still leaving inside some other place.

But this is a minor point really, if most of you like get() better, let it
be get().

Fernando Cacciola



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to