39 typedef typename T::parent_type
P;
41 static bool equiv(
const T& a,
const T& b) {
return a == b; }
43 static bool equiv(
const std::shared_ptr<T>& a,
const std::shared_ptr<T>& b) {
44 return a->operator==(*b.get());
47 static bool equiv(
const T* a,
const std::shared_ptr<T>& b) {
48 return a->operator==(*b.get());
51 static bool equiv(
const std::shared_ptr<T>& b,
const T* a) {
52 return a->operator==(*b.get());
55 static bool equiv(
const T* a,
const T& b) {
return a->operator==(b); }
57#if !PTREQUIV_USE_TYPEID
59 static bool equiv(
const std::shared_ptr<T>& a,
const std::shared_ptr<P>& b) {
60 std::shared_ptr<T> b_cast = std::dynamic_pointer_cast<T, P>(b);
64 return a->operator==(*b_cast.get());
67 static bool equiv(
const T* a,
const std::shared_ptr<P>& b) {
68 std::shared_ptr<T> b_cast = std::dynamic_pointer_cast<T, P>(b);
72 return a->operator==(*b_cast.get());
75 static bool equiv(
const T* a,
const std::shared_ptr<DGVertex>& b) {
76 std::shared_ptr<T> b_cast = std::dynamic_pointer_cast<T, DGVertex>(b);
80 return a->operator==(*b_cast.get());
85 static bool equiv(
const std::shared_ptr<T>& a,
const std::shared_ptr<P>& b) {
86 if (a->typeid_ != b->typeid_)
89 std::shared_ptr<T> b_cast = std::static_pointer_cast<T, P>(b);
90 return a->operator==(*b_cast.get());
94 static bool equiv(
const T* a,
const std::shared_ptr<DGVertex>& b) {
95 if (a->typeid_ != b->typeid_)
98#if PTREQUIV_USE_KEY_TO_COMPARE
99#if PTREQUIV_USE_INSTID
100 return a->instid_ == b->instid_;
102 return a->label() == b->label();
105 std::shared_ptr<T> b_cast = std::static_pointer_cast<T, DGVertex>(b);
106 return a->operator==(*b_cast.get());