pointersEqual.h
Go to the documentation of this file.
1 #ifndef art_Utilities_pointersEqual_h
2 #define art_Utilities_pointersEqual_h
3 // Compare two pointers taking into account possible multiple inheritance
4 
6 
7 #include <type_traits>
8 
9 namespace art {
10  template <typename T1, typename T2>
14  bool>
16  {
17  return t1 == t2;
18  }
19 
20  // Not compatible.
21  template <typename T1, typename T2>
25  bool>
27  {
29  << "Tried to compare two incompatible pointers.\n";
30  }
31 } // namespace art
32 
33 #endif /* art_Utilities_pointersEqual_h */
34 
35 // Local Variables:
36 // mode: c++
37 // End:
Definition: 013_class.h:14
std::enable_if_t< std::is_same< T1, T2 >::value||std::is_base_of< T1, T2 >::value||std::is_base_of< T2, T1 >::value, bool > pointersEqual(T1 *t1, T2 *t2)
Definition: pointersEqual.h:15
Definition: 013_class.h:10
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66