aboutsummaryrefslogtreecommitdiff
path: root/c++-libbu++/src/integer.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/integer.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 'c++-libbu++/src/integer.cpp')
-rw-r--r--c++-libbu++/src/integer.cpp22
1 files changed, 22 insertions, 0 deletions
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 )
39 readPackedInt( rIn, iVal ); 39 readPackedInt( rIn, iVal );
40} 40}
41 41
42Gats::Integer &Gats::Integer::operator=( const Gats::Integer &rhs )
43{
44 iVal = rhs.iVal;
45 return *this;
46}
47
48Gats::Integer &Gats::Integer::operator=( int64_t rhs )
49{
50 iVal = rhs;
51 return *this;
52}
53
54bool Gats::Integer::operator==( const Gats::Integer &rhs )
55{
56 return iVal == rhs.iVal;
57}
58
59bool Gats::Integer::operator==( int64_t rhs )
60{
61 return iVal == rhs;
62}
63
42Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::Integer &i ) 64Bu::Formatter &operator<<( Bu::Formatter &f, const Gats::Integer &i )
43{ 65{
44 return f << "(int) " << i.getValue(); 66 return f << "(int) " << i.getValue();