26 template <
typename TDerived>
30 TDerived
sum(derived());
34 friend TDerived
operator-(
const TDerived& value1,
const TDerived& value2) {
37 return value1 + (-value2);
40 return derived().operator+=(-other);
43 return !(derived() == other);
48 TDerived multiplied(derived());
53 return derived * value;
57 return derived() * (1._f / value);
61 return derived().operator*=(1._f / value);
65 INLINE TDerived& derived() {
66 return static_cast<TDerived&
>(*this);
69 INLINE const TDerived& derived()
const {
70 return static_cast<const TDerived&
>(*this);
#define SPH_ASSERT(x,...)
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
#define INLINE
Macros for conditional compilation based on selected compiler.
#define NAMESPACE_SPH_END
Class defining additional operators from existing ones.
TDerived operator+(const TDerived &other) const
TDerived & operator-=(const TDerived &other)
friend TDerived operator-(const TDerived &value1, const TDerived &value2)
TDerived & operator/=(const Float value)
bool operator!=(const TDerived &other) const
TDerived operator*(const Float value) const
friend TDerived operator*(const Float value, const TDerived &derived)
TDerived operator/(const Float value) const