ampsci
High-precision calculations for one- and two-valence atomic systems
qip::Comparison< T, U >

ok

template<typename T, typename U = T>
class qip::Comparison< T, U >

Helper template that provides !=, >, <=, >= given == and <.

Derive publicly from this (with T = your class) and implement == and <; the remaining comparison operators are provided automatically.

class C : public qip::Comparison<C> {
friend bool operator==(const C &lhs, const C &rhs);
friend bool operator<(const C &lhs, const C &rhs);
};
Helper template that provides !=, >, <=, >= given == and <.
Definition Template.hpp:36

For mixed-type comparisons, inherit multiple specialisations:

class D : public qip::Comparison<D>,
friend bool operator==(const D &lhs, const D &rhs);
friend bool operator<(const D &lhs, const D &rhs);
friend bool operator==(const D &lhs, const C &rhs);
friend bool operator<(const D &lhs, const C &rhs);
friend bool operator==(const C &lhs, const D &rhs);
friend bool operator<(const C &lhs, const D &rhs);
};

#include <Template.hpp>

Friends

bool operator!= (const T &lhs, const U &rhs)
 
bool operator> (const T &lhs, const U &rhs)
 
bool operator<= (const T &lhs, const U &rhs)
 
bool operator>= (const T &lhs, const U &rhs)
 

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