aboutsummaryrefslogtreecommitdiff
path: root/c++-libbu++/src/float.cpp
diff options
context:
space:
mode:
authorMike Buland <mbuland@penny-arcade.com>2021-09-27 08:04:28 -0700
committerMike Buland <mbuland@penny-arcade.com>2021-09-27 08:04:28 -0700
commit7ebfdb3e7b71fdd315032adb0854e28f0073e1f7 (patch)
treea69ac57986342792cc76e2759091e855b3255ca8 /c++-libbu++/src/float.cpp
parent701b05de4d2e79afd88ef8ddf93ba0fcc0eb5b14 (diff)
downloadlibgats-7ebfdb3e7b71fdd315032adb0854e28f0073e1f7.tar.gz
libgats-7ebfdb3e7b71fdd315032adb0854e28f0073e1f7.tar.bz2
libgats-7ebfdb3e7b71fdd315032adb0854e28f0073e1f7.tar.xz
libgats-7ebfdb3e7b71fdd315032adb0854e28f0073e1f7.zip
Added explicit assignment/comparison operators.
Added = and == to all primitive types, not to the container types (yet?).
Diffstat (limited to '')
-rw-r--r--c++-libbu++/src/float.cpp22
1 files changed, 22 insertions, 0 deletions
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 )
130 } 130 }
131} 131}
132 132
133Gats::Float &Gats::Float::operator=( const Gats::Float &rhs )
134{
135 fVal = rhs.fVal;
136 return *this;
137}
138
139Gats::Float &Gats::Float::operator=( float &rhs )
140{
141 fVal = rhs;
142 return *this;
143}
144
145bool Gats::Float::operator==( const Gats::Float &rhs ) const
146{
147 return fVal == rhs.fVal;
148}
149
150bool Gats::Float::operator==( float rhs ) const
151{
152 return fVal == rhs;
153}
154
133Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::Float &flt ) 155Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::Float &flt )
134{ 156{
135 return f << "(float) " << flt.getValue(); 157 return f << "(float) " << flt.getValue();