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_math.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'modules/codec/c++/data_math.hpp') diff --git a/modules/codec/c++/data_math.hpp b/modules/codec/c++/data_math.hpp index 48dae91..9d07eb3 100644 --- a/modules/codec/c++/data_math.hpp +++ b/modules/codec/c++/data_math.hpp @@ -131,6 +131,19 @@ public: return c; } + data, encode::Native> operator-() const { + data, encode::Native> c; + + rank_iterator::in_fixed_bounds([&](const data, encode::Native>& index) -> error_or{ + c.at(index) = -at(index); + return make_void(); + }); + + return c; + } + + + template data, encode::Native> cast_to() const { data, encode::Native> native_change; -- cgit v1.2.3