Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Sptr.hpp"
- class A
- {
- public:
- int a;
- int* b;
- A( int i)
- {
- b = new int(i);
- }
- ~A()
- {
- delete b;
- }
- A() = delete;
- };
- using namespace cs540;
- int main()
- {
- Sptr<A> a(new A(1));
- Sptr<A> b(new A(2));
- int a1 = *(a.refcount);
- int b1 = *(b.refcount);
- a = b;
- a1 = *(a.refcount);
- b1 = *(b.refcount);
- int test;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement