From 60eefb228c9b5c2846d3640d68ae5a7ccb0c254d Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 1 Jun 2026 16:09:22 +0200 Subject: Adding unary - operator --- modules/codec/c++/data.hpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/codec/c++/data.hpp') diff --git a/modules/codec/c++/data.hpp b/modules/codec/c++/data.hpp index ae9d8eb..79a6ab8 100644 --- a/modules/codec/c++/data.hpp +++ b/modules/codec/c++/data.hpp @@ -171,6 +171,10 @@ public: constexpr data operator-(const data& rhs)const{ return {get() - rhs.get()}; } + + constexpr data operator-() const { + return {-get()}; + } constexpr data& operator++() { set(get() + static_cast::type>(1)); -- cgit v1.2.3