35template <
typename T,
typename U = T>
37 friend bool operator!=(
const T &lhs,
const U &rhs) {
return !(lhs == rhs); }
38 friend bool operator>(
const T &lhs,
const U &rhs) {
return rhs < lhs; }
39 friend bool operator<=(
const T &lhs,
const U &rhs) {
return !(lhs > rhs); }
40 friend bool operator>=(
const T &lhs,
const U &rhs) {
return !(lhs < rhs); }
52 friend T operator+(T lhs,
const T &rhs) {
return lhs += rhs; }
53 friend T operator-(T lhs,
const T &rhs) {
return lhs -= rhs; }
54 friend T operator*(T lhs,
const T &rhs) {
return lhs *= rhs; }
55 friend T operator/(T lhs,
const T &rhs) {
return lhs /= rhs; }
65template <
typename T,
typename U>
67 friend T operator+(T lhs,
const U &rhs) {
return lhs += rhs; }
68 friend T operator-(T lhs,
const U &rhs) {
return lhs -= rhs; }
69 friend T operator*(T lhs,
const U &rhs) {
return lhs *= rhs; }
70 friend T operator/(T lhs,
const U &rhs) {
return lhs /= rhs; }
72 friend T operator+(
const U &lhs, T rhs) {
return rhs += lhs; }
73 friend T operator*(
const U &lhs, T rhs) {
return rhs *= lhs; }
Like Arithmetic, but for two different types (T op U).
Definition Template.hpp:66
Helper template that provides +, -, *, / given +=, -=, *=, /=.
Definition Template.hpp:51
Helper template that provides !=, >, <=, >= given == and <.
Definition Template.hpp:36
General-purpose utility library.
Definition Array.hpp:23