Boost logo

Boost :

Subject: Re: [boost] Pimpl Again?
From: Rob Stewart (rstewart_at_[hidden])
Date: 2016-05-31 17:45:48


On May 31, 2016 5:10:35 PM EDT, Emil Dotchevski <emildotchevski_at_[hidden]> wrote:
>
>I'm not sure why
>do you say that "my approach" doesn't support that. One possibility is
>to use inheritance in the cpp file:
>
>header:
>
>struct foo { int critical_; };
>shared_ptr<foo> create_foo();
>inline void use_foo_critical( foo * p ) { ++p->critical_; }
>void use_foo_not_so_critical( foo * )

Were you leaving encapsulation as an exercise for the reader?

class foo
{
public:
   use_critical () { ++critical_; }
protected:
   int critical_;
};

Your foo_ can still access critical_.

___
Rob

(Sent from my portable computation engine)


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