Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2002-10-02 13:19:27


"Peter Dimov" <pdimov_at_[hidden]> wrote in message
news:007501c26a0d$f94c6e10$1d00a8c0_at_pdimov2...
> [...]
> We went over this a few times here and on comp.lang.c++.moderated.

The posts I found in the archives more or less said: "If you want a pointer-
to-const, use ptr<T const>". I didn't really see anything justifying the
position. I didn't look at c.l.c.m., though.

> [...]
> shared_ptr is "as close to raw pointers as possible but no closer".

Well, I'm actually suggesting something that raw pointers *don't* do,
because raw pointer syntax happens to be more convenient. I understand
the motivation for the status quo, however.

> The genericity argument - add_const_to_element - is new, however. Do
> people really need such a primitive? Any motivating examples taken from
> real world code, preferably with identifier names intact, no Widgets and
> Foos?

Hey, where would the world be without Widgets and Foos? ;) Anyway,
I personally don't like the wrapper, for the reasons I stated originally:
it's even less convenient than just specifying ptr<T const> and you still
have
to copy the pointer. It seems to me that it gets you nothing but increased
verbosity.

Dave


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