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/float.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'c++-libbu++/src/float.cpp') diff --git a/c++-libbu++/src/float.cpp b/c++-libbu++/src/float.cpp index c011794..409efd7 100644 --- a/c++-libbu++/src/float.cpp +++ b/c++-libbu++/src/float.cpp @@ -130,6 +130,28 @@ void Gats::Float::read( Bu::Stream &rIn, char cType ) } } +Gats::Float &Gats::Float::operator=( const Gats::Float &rhs ) +{ + fVal = rhs.fVal; + return *this; +} + +Gats::Float &Gats::Float::operator=( float &rhs ) +{ + fVal = rhs; + return *this; +} + +bool Gats::Float::operator==( const Gats::Float &rhs ) const +{ + return fVal == rhs.fVal; +} + +bool Gats::Float::operator==( float rhs ) const +{ + return fVal == rhs; +} + Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::Float &flt ) { return f << "(float) " << flt.getValue(); -- cgit v1.2.3