Boost logo

Boost :

From: Philippe A. Bouchard (philippeb_at_[hidden])
Date: 2003-01-30 16:32:01


"Greg Colvin" <Gregory.Colvin_at_[hidden]> wrote in message
news:5.2.0.9.2.20030129155641.027b5f98_at_rgmgitmail.oraclecorp.com...
> I notice that a special operator new must be used
> to create objects pointed to by shifted_ptr. Is
> this really necessaty? It prevents shifted_ptr
> from just being an alternative implementation of
> shared_ptr.

The only difference consist of adding (so) when using operator new. This is
the only "cost" of using shifted_ptr:
shared_ptr<int> p = new int(9);

shifted_ptr<int> p = new (so) int(9);

There are low level solutions for this but for now, let's keep it C++
oriented. I'll take a look at other policy based pointers at the same time.

Philippe A. Bouchard


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