Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2004-01-05 00:31:07


"Thorsten Ottosen" <nesotto_at_[hidden]> wrote in message
news:btap93$32k$1_at_sea.gmane.org...
> "David B. Held" <dheld_at_[hidden]> wrote in message
> news:bt9u41$9c6$1_at_sea.gmane.org...
> [...]
> > Maybe it's more verbose than you want, but it's essentially
> > what you'd have to do with a raw pointer, no?
>
> It's too trouplesome, so I would just accept that I have no compiler
> warnings.

Which is what I do for those situations. ;)

> [...]
> AFAICT, one member function i eg. shared_ptr would let us get
> by without any cast at all.

But wouldn't the cast really hide inside this mem-fun?

> [...]
> AFAIR, the pointer was not allowed to be 0 inside foo().

I don't remember anyone saying that, but you can still imagine
the case where there is no such requirement.

> [...]
> If you need that, why don't you do it like this:
>
> void foo( T* t );
> foo( &*p );
>
> ?

Because then you are saying that foo takes an unmanaged
pointer, of course. And that is a different thing than taking
a managed pointer, right (despite what we say about
drop-in replacement ;)? Also, it seems very awkward to
switch between trafficking in smart pointers to trafficking in
raw pointers just to work around deep const. It's this kind
of tradeoff here and tradeoff there that makes it a not-so-
obvious win to me.

> [...]
> I must have forgot. Isn't foo( T& ); and foo( T* ) enough?

If you don't believe an interface should also be documentation,
maybe.

> [...]
> >Making the change you suggest would break
> > thousands, possibly millions of lines of code. Is it worth it?
>
> That is not that relevant for the discussion. I would be if a change
> was actually made.

LOL! I propose that we add the keyword 'type' to the language
to indicate a variant type. Now, when discussing the merits of
this proposed change, disregard any potential name clash with
existing uses of this name, because that would only be relevant
*after* the proposal is accepted. ;>

> [...]
> > At best, I think it should be an optional policy that you can
> > choose to select for applications such as yours, and that's
> > what I will focus on doing for policy_ptr.
>
> Ok, that sounds great.

I'm glad we can agree on something. ;)

Dave

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.556 / Virus Database: 348 - Release Date: 12/26/2003

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