diff options
| author | Mike Buland <mbuland@penny-arcade.com> | 2021-09-27 08:04:28 -0700 |
|---|---|---|
| committer | Mike Buland <mbuland@penny-arcade.com> | 2021-09-27 08:04:28 -0700 |
| commit | 7ebfdb3e7b71fdd315032adb0854e28f0073e1f7 (patch) | |
| tree | a69ac57986342792cc76e2759091e855b3255ca8 /c++-libbu++/src/float.cpp | |
| parent | 701b05de4d2e79afd88ef8ddf93ba0fcc0eb5b14 (diff) | |
| download | libgats-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.cpp | 22 |
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 | ||
| 133 | Gats::Float &Gats::Float::operator=( const Gats::Float &rhs ) | ||
| 134 | { | ||
| 135 | fVal = rhs.fVal; | ||
| 136 | return *this; | ||
| 137 | } | ||
| 138 | |||
| 139 | Gats::Float &Gats::Float::operator=( float &rhs ) | ||
| 140 | { | ||
| 141 | fVal = rhs; | ||
| 142 | return *this; | ||
| 143 | } | ||
| 144 | |||
| 145 | bool Gats::Float::operator==( const Gats::Float &rhs ) const | ||
| 146 | { | ||
| 147 | return fVal == rhs.fVal; | ||
| 148 | } | ||
| 149 | |||
| 150 | bool Gats::Float::operator==( float rhs ) const | ||
| 151 | { | ||
| 152 | return fVal == rhs; | ||
| 153 | } | ||
| 154 | |||
| 133 | Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::Float &flt ) | 155 | Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::Float &flt ) |
| 134 | { | 156 | { |
| 135 | return f << "(float) " << flt.getValue(); | 157 | return f << "(float) " << flt.getValue(); |
