Jpp
Friends | List of all members
JLANG::JEquals< JFirst_t, JSecond_t > Struct Template Reference

Template definition of auxiliary base class for comparison of data structures. More...

#include <JEquals.hh>

Inheritance diagram for JLANG::JEquals< JFirst_t, JSecond_t >:
JDETECTOR::JModuleAddress JEEP::JStatus JEEP::JVersion JGEOMETRY3D::JQuaternion3D JMATH::JMatrix1D JMATH::JMatrix2D JMATH::JMatrix3D JMATH::JMatrix4D JMATH::JMatrix5D JMATH::JMatrixND JTOOLS::JRange< counter_type > JTOOLS::JRange< double > JTOOLS::JRange< int > JTOOLS::JRange< JAbscissa_t > JTOOLS::JRange< T, JComparator_t >

Friends

bool operator== (const JFirst_t &first, typename JClass< JSecond_t >::argument_type second)
 Equal operator. More...
 
bool operator== (typename JClass< JSecond_t >::argument_type first, const JFirst_t &second)
 Equal operator. More...
 
bool operator!= (const JFirst_t &first, typename JClass< JSecond_t >::argument_type second)
 Not equal operator. More...
 
bool operator!= (typename JClass< JSecond_t >::argument_type first, const JFirst_t &second)
 Not equal operator. More...
 

Detailed Description

template<class JFirst_t, class JSecond_t>
struct JLANG::JEquals< JFirst_t, JSecond_t >

Template definition of auxiliary base class for comparison of data structures.

Specialisation of class JEquals for two data types.

The various specialisations of this class implement the operators == != .

The first template parameter should have the corresponding member methods:

      bool equals(const JFirst_t&) const;
      bool equals(const JSecond_t&) const;

where JFirst_t and JSecond_t refer to the first and second template parameter, respectively. The second template parameter may be a primitive data type. This class uses in-class friend operators (see Barton-Nackman trick).

Definition at line 24 of file JEquals.hh.

Friends And Related Function Documentation

◆ operator== [1/2]

template<class JFirst_t, class JSecond_t>
bool operator== ( const JFirst_t &  first,
typename JClass< JSecond_t >::argument_type  second 
)
friend

Equal operator.

Parameters
firstfirst object
secondsecond object
Returns
true if two objects are equal; else false

Definition at line 92 of file JEquals.hh.

94  {
95  return first.equals(second);
96  }

◆ operator== [2/2]

template<class JFirst_t, class JSecond_t>
bool operator== ( typename JClass< JSecond_t >::argument_type  first,
const JFirst_t &  second 
)
friend

Equal operator.

Parameters
firstfirst object
secondsecond object
Returns
true if two objects are equal; else false

Definition at line 106 of file JEquals.hh.

108  {
109  return second.equals(first);
110  }

◆ operator!= [1/2]

template<class JFirst_t, class JSecond_t>
bool operator!= ( const JFirst_t &  first,
typename JClass< JSecond_t >::argument_type  second 
)
friend

Not equal operator.

Parameters
firstfirst object
secondsecond object
Returns
true if two objects are not equal; else false

Definition at line 120 of file JEquals.hh.

122  {
123  return !first.equals(second);
124  }

◆ operator!= [2/2]

template<class JFirst_t, class JSecond_t>
bool operator!= ( typename JClass< JSecond_t >::argument_type  first,
const JFirst_t &  second 
)
friend

Not equal operator.

Parameters
firstfirst object
secondsecond object
Returns
true if two objects are not equal; else false

Definition at line 134 of file JEquals.hh.

136  {
137  return !second.equals(first);
138  }

The documentation for this struct was generated from the following file: