diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-02-16 15:50:40 +0100 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2024-02-16 15:50:40 +0100 |
commit | 35635f5514a9f702b5606146bf9ff4494030ff8f (patch) | |
tree | e106742b502e93053943aaccd85040147a28c3de /modules/codec/c++/data.hpp | |
parent | da93f0466cdeaf266debe5bacee6779354cf4a34 (diff) |
core,tools,codec: Moving towards lang tooling
Diffstat (limited to 'modules/codec/c++/data.hpp')
-rw-r--r-- | modules/codec/c++/data.hpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/modules/codec/c++/data.hpp b/modules/codec/c++/data.hpp index ca976d5..2196408 100644 --- a/modules/codec/c++/data.hpp +++ b/modules/codec/c++/data.hpp @@ -430,21 +430,31 @@ public: typename native_data_type<schema::Primitive<T,N>>::type get() const {return value_;} - data<schema::Primitive<T,N>, encode::Native> operator*(const saw::data<schema::Primitive<T,N>, encode::Native>& rhs)const{ + data<schema::Primitive<T,N>, encode::Native> operator*(const data<schema::Primitive<T,N>, encode::Native>& rhs)const{ return {get() * rhs.get()}; } - data<schema::Primitive<T,N>, encode::Native> operator/(const saw::data<schema::Primitive<T,N>, encode::Native>& rhs)const{ + data<schema::Primitive<T,N>, encode::Native> operator/(const data<schema::Primitive<T,N>, encode::Native>& rhs)const{ return {get() / rhs.get()}; } - data<schema::Primitive<T,N>, encode::Native> operator+(const saw::data<schema::Primitive<T,N>, encode::Native>& rhs)const{ + data<schema::Primitive<T,N>, encode::Native> operator+(const data<schema::Primitive<T,N>, encode::Native>& rhs)const{ return {get() + rhs.get()}; } - data<schema::Primitive<T,N>, encode::Native> operator-(const saw::data<schema::Primitive<T,N>, encode::Native>& rhs)const{ + data<schema::Primitive<T,N>, encode::Native> operator-(const data<schema::Primitive<T,N>, encode::Native>& rhs)const{ return {get() - rhs.get()}; } + + template<typename Enc> + bool operator==(const data<schema::Primitive<T,N>, Enc>& rhs)const{ + return get() == rhs.get(); + } + + template<typename Enc> + bool operator<(const data<schema::Primitive<T,N>, Enc>& rhs) const { + return get() < rhs.get(); + } }; |