Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- class Shared : public std::enable_shared_from_this<Shared>{
- public:
- int prea;
- };
- class Widget : public virtual Shared{
- int a;
- public:
- ~A(){
- a = 7;
- }
- };
- class Container : virtual public Widget{
- };
- class List : private Container, virtual public Widget{
- public:
- int c;
- };
- int main(int argc, char** argv){
- auto c = std::make_shared<List>();
- c->c = 3;
- std::cout << c->c << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement