From 7ebfdb3e7b71fdd315032adb0854e28f0073e1f7 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 27 Sep 2021 08:04:28 -0700 Subject: Added explicit assignment/comparison operators. Added = and == to all primitive types, not to the container types (yet?). --- c++-libbu++/src/integer.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'c++-libbu++/src/integer.cpp') diff --git a/c++-libbu++/src/integer.cpp b/c++-libbu++/src/integer.cpp index f63dd37..1f10279 100644 --- a/c++-libbu++/src/integer.cpp +++ b/c++-libbu++/src/integer.cpp @@ -39,6 +39,28 @@ void Gats::Integer::read( Bu::Stream &rIn, char cType ) readPackedInt( rIn, iVal ); } +Gats::Integer &Gats::Integer::operator=( const Gats::Integer &rhs ) +{ + iVal = rhs.iVal; + return *this; +} + +Gats::Integer &Gats::Integer::operator=( int64_t rhs ) +{ + iVal = rhs; + return *this; +} + +bool Gats::Integer::operator==( const Gats::Integer &rhs ) +{ + return iVal == rhs.iVal; +} + +bool Gats::Integer::operator==( int64_t rhs ) +{ + return iVal == rhs; +} + Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::Integer &i ) { return f << "(int) " << i.getValue(); -- cgit v1.2.3