summaryrefslogtreecommitdiff
path: root/include/o3tl
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2020-12-22 15:42:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-01-02 15:26:38 +0100
commit11e52fe2979b0947814a49b9c17ec373795cbf8e (patch)
tree48268579f052b7fdfcc2c334fffe8c91d29cb234 /include/o3tl
parent610ceb05025c9c7a9a34dddcb0dac506b8eab441 (diff)
introduce Degree100 strong_int type
Change-Id: I78f837a1340be0ca5c49097f543a481b7b43a632 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108367 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/o3tl')
-rw-r--r--include/o3tl/strong_int.hxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/o3tl/strong_int.hxx b/include/o3tl/strong_int.hxx
index 3db958212229..82107955897f 100644
--- a/include/o3tl/strong_int.hxx
+++ b/include/o3tl/strong_int.hxx
@@ -113,10 +113,16 @@ public:
strong_int& operator+=(strong_int const & other) { m_value += other.m_value; return *this; }
strong_int& operator-=(strong_int const & other) { m_value -= other.m_value; return *this; }
strong_int& operator%=(strong_int const & other) { m_value %= other.m_value; return *this; }
+ strong_int& operator*=(strong_int const & other) { m_value *= other.m_value; return *this; }
+ strong_int& operator/=(strong_int const & other) { m_value /= other.m_value; return *this; }
[[nodiscard]]
strong_int operator%(strong_int const & other) const { return strong_int(m_value % other.m_value); }
[[nodiscard]]
strong_int operator-() const { return strong_int(-m_value); }
+ [[nodiscard]]
+ strong_int operator*(strong_int const & other) const { return strong_int(m_value * other.m_value); }
+ [[nodiscard]]
+ strong_int operator/(strong_int const & other) const { return strong_int(m_value / other.m_value); }
bool anyOf(strong_int v) const {
return *this == v;