33 template<
typename TYPE>
36 union Un { FXuval val; TYPE* ptr; };
57 TYPE* ptr()
const { Un x={as.val&~1L};
return x.ptr; }
60 operator TYPE*()
const {
return ptr(); }
63 TYPE& operator*()
const {
return *ptr(); }
66 TYPE* operator->()
const {
return ptr(); }
69 operator FXbool()
const {
return !!ptr(); }
72 FXbool operator!()
const {
return !ptr(); }
75 FXbool operator==(TYPE *p)
const {
return ptr()==p; }
78 FXbool operator!=(TYPE *p)
const {
return ptr()!=p; }
81 FXbool flag()
const {
return !!(as.val&1L); }
84 void flag(FXbool flg){ as.val^=((0-flg)^as.val)&1L; }
87 void flip(){ as.val^=1L; }
Marked pointer keeps a flag bit inside of a dynamically allocated pointer; this is possible because m...
Definition: FXMarkedPtr.h:34
Definition: FX4Splitter.h:28