Boost logo

Boost :

From: Alisdair Meredith (alisdair.meredith_at_[hidden])
Date: 2002-01-30 06:04:19

Date: Sat, 26 Jan 2002 10:17:16 -0800
   From: "Andrei Alexandrescu" <andrewalex_at_[hidden]>
Subject: Re: Why are we looking for a boost/Loki smart-pointer merginf?

> Question: given that you do need a truly smart smart pointer, which can also
> do what scoped_ptr does, do you still need scoped_ptr as an old palimpsest
> in the library? If yes, why? Or would a one-liner typedef do?

As I stated originally, my answer for this one is an unequivocal 'yes', and the additional 'equivalent' typedef would be useful for instructive purposes.

Until the majority of people programming with C++ are happy and familiar with template techniques, it is extremely useful that there are simple templates like scoped_ptr that teach good habits and are easily grasped. There is little to be gained from all the loki machinery for this 'trivial' case. There is a huge benefit in the simplicity simply for reaching broader acceptance and a large audience.

> Since the discussion started, I saw two Loki-like smart pointer
> implementations posted. Seems like a Loki-like implementation would be
> acceptable as long as it's not Loki itself. Given my recent posting history,
> I guess I don't have enough feathers to fuss about that :o).

Well, I don't think any library gets carte-blanche acceptance through the boost review process. The authors of Regex and BGL will know more about this than I though!

As for extra loki-like proposals? I think Lee was having a go himself to understand the idea involved, rather than proposing a new pointer for the library. Sometimes having a go helps us realise there is indeen more involved than we first thought (as I found out quite recently in another thread myself)

There has been a natural evolution of the existing boost shared_ptr, a library I can see taking much benefit from the policy approach. Given the well-documented work on the Loki pointer I would be quite surprised if it doesn't eventually form the basis of that new library (as long as we can keep the original author interested!) but somehow doubt we will simply see it dropped straight in either. Unfortunately, the ideas invovled still race at a level slightly higher than I can usefully contribute to, which is why I am resricting myself to campaigning for a simpler variant as well (for the record, I have long complained in other circles that auto_ptr is too complex for such use as well :* )



For further information on Renault F1 visit our web site at This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please destroy and notify Renault F1 on +44 1608678000."


Boost list run by bdawes at, gregod at, cpdaniel at, john at