#include <ShoreApp.h> int REF(T)::operator==(const REF(T) &ref) const; int REF(T)::operator!=(const REF(T) &ref) const; int REF(T)::operator==(const T *p) const; int REF(T)::operator!=(const T *p) const; REF(T)::operator int() const;
These operators implement equality comparisons among refs. The first two forms indicate whether two REF(T)s point to the same object. The second two forms indicate whether the ref points to the same object as the given virtual memory pointer. The final form returns 0 if the ref is nil, 1 otherwise.
REF(Part) p1, p2; if(p1 == p2) ... if(p1 != 0) ... if(p1) ...The first if-statement succeeds if p1 and p2 point to the same part object. The second and third if-statements are equivalent, and they succeed if p1 is not a nil ref.
In the current release of Shore, it is safe to compare refs whose targets have been destroyed. But in general, this practice is discouraged, as it may not be supported in future Shore releases.