1 #ifndef _library__gc__hpp__included__
2 #define _library__gc__hpp__included__
17 virtual void trace() = 0;
25 template<class T
> class pointer
36 template<typename
... U
> pointer(obj_tag tag
, U
... args
)
40 pointer(const pointer
& p
)
42 if(p
.ptr
) p
.ptr
->mark_root();
45 pointer
& operator=(const pointer
& p
)
47 if(ptr
== p
.ptr
) return *this;
48 if(ptr
) ptr
->unmark_root();
49 if(p
.ptr
) p
.ptr
->mark_root();
55 if(ptr
) ptr
->unmark_root();
61 T
* operator->() { return ptr
; }
62 T
& operator*() { return *ptr
; }
63 T
* as_pointer() { return ptr
; }