#pragma once #include namespace wolff { template struct height_t { T x; height_t() : x(0) {} height_t(T x) : x(x) {} typedef T M_t; typedef double F_t; inline T operator*(unsigned a) const { return x * a; } inline double operator*(double a) const { return x * a; } inline T operator-(const height_t& h) const { return x - h.x; } }; template inline typename height_t::M_t operator*(unsigned a, height_t h) { return h * a; } template inline typename height_t::F_t operator*(double a, height_t h) { return h * a; } template inline T& operator+=(T& M, const height_t &h) { M += h.x; return M; } template inline T& operator-=(T& M, const height_t &h) { M -= h.x; return M; } }