Boost logo

Boost :

Subject: Re: [boost] [Block Pointer] Update
From: Phil Bouchard (philippeb8_at_[hidden])
Date: 2016-03-13 22:44:32


On 03/13/2016 10:23 PM, Gavin Lambert wrote:
>
> What about slicing, though? Or have you removed the base-class
> association between the two?

If I understand your question correctly then it works fine:

struct B
{
     int i;

     B() : i(9) {}
};

struct C : B
{
};

void bar(node_ptr<B> p)
{
     cout << p->i << endl;
}

int main()
{
     cout << "Slicing:" << endl;
     {
         root_ptr<C> p = new node<C>();
         bar(p);
     }
     cout << endl;
}

I need to take a break now ;)


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