Boost logo

Boost :

From: Philippe A. Bouchard (philippeb_at_[hidden])
Date: 2002-07-23 14:16:57


"David B. Held" <dheld_at_[hidden]> wrote in message
news:ahk7gm$6jj$1_at_main.gmane.org...
> "Philippe A. Bouchard" <philippeb_at_[hidden]> wrote in message
> news:ahk2n3$nfh$1_at_main.gmane.org...
> > I was talking about Loki::SmartPtr. I'm not familiar with policy-based
> > smart pointers but I suspect it is template-based?
>
> As is squad_ptr<>. Or perhaps the part that says:

Sorry I wasn't specific enough. What I meant is: does the object pointed to
needs to be properly wrapped using policy-based smart pointers (what are
they anyways?)?

class referenced1
{
public:
    int counter

    char name *;
    ...
};

class referenced2
{
public:
    int counter

    char name *;
    ...
};

policy_based_smart_pointer<referenced1> p1 = new referenced1();

policy_based_smart_pointer<referenced2> p2 = new referenced2();

[...]

> > Can it be applied to TrollTech's QListView for example?
>
> I'm not familiar with that, but I don't see why not.

It's a widget with a disabled copy contructor. The original constructor is
important and cannot be wrapped. You cannot also just rewrite it to make it
derive from counted_base. The only option left is a separate reference
counter thus efficienty is dropping right now. QListViewItem is another
class with important constructor*s*.

[...]

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