Jpp  18.1.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JComparisonToolkit.hh
Go to the documentation of this file.
1 #ifndef __JEEP__JCOMPARISONTOOLKIT__
2 #define __JEEP__JCOMPARISONTOOLKIT__
3 
5 #include "JLang/JBool.hh"
6 
7 
8 /**
9  * \author mdejong
10  */
11 
12 namespace JEEP {}
13 namespace JPP { using namespace JEEP; }
14 
15 namespace JEEP {
16 
17  using JLANG::JComparisonAvailable;
18  using JLANG::JBool;
19 
20 
21 
22  /**
23  * Comparison of comparable objects.
24  *
25  * \param first first object
26  * \param second second object
27  * \return true if objects are equal; else false
28  */
29  template<class T>
30  inline bool compareObjects(const T& first,
31  const T& second,
33  {
34  return first == second;
35  }
36 
37 
38  /**
39  * Comparison of uncomparable objects.
40  *
41  * \param first first object
42  * \param second second object
43  * \return false
44  */
45  template<class T>
46  inline bool compareObjects(const T& first,
47  const T& second,
49  {
50  return false;
51  }
52 
53 
54  /**
55  * Comparison of objects.
56  *
57  * \param first first object
58  * \param second second object
59  * \return true if objects are comparable and equal; else false
60  */
61  template<class T>
62  inline bool compareObjects(const T& first,
63  const T& second)
64  {
65  return compareObjects(first, second, JBool<JComparisonAvailable<T>::has_eq>());
66  }
67 }
68 
69 #endif
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
Auxiliary template class for type bool.
Definition: JBool.hh:20
do set_variable OUTPUT_DIRECTORY $WORKDIR T
bool compareObjects(const T &first, const T &second, JBool< true >)
Comparison of comparable objects.