diff options
author | Charles E. Rolke <chug@apache.org> | 2011-04-26 20:38:06 +0000 |
---|---|---|
committer | Charles E. Rolke <chug@apache.org> | 2011-04-26 20:38:06 +0000 |
commit | e2147e00b4120d4285ebcfaa9d97817c7fdc7600 (patch) | |
tree | 7db57835737e988c4d3160256b2cd295c225093b | |
parent | 19f093d982161547005593e57f47111a4c578667 (diff) | |
download | qpid-python-e2147e00b4120d4285ebcfaa9d97817c7fdc7600.tar.gz |
QPID-3226 Define more intuitive equality operators for Duration instances
Add == and != operators for Duration class.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1096898 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | cpp/bindings/qpid/dotnet/src/Duration.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/cpp/bindings/qpid/dotnet/src/Duration.h b/cpp/bindings/qpid/dotnet/src/Duration.h index 213c338a59..d4239fae88 100644 --- a/cpp/bindings/qpid/dotnet/src/Duration.h +++ b/cpp/bindings/qpid/dotnet/src/Duration.h @@ -81,7 +81,17 @@ namespace Messaging { Duration ^ result = gcnew Duration(multiplier * dur->Milliseconds);
return result;
}
- };
+
+ static bool operator == (Duration ^ a, Duration ^ b)
+ {
+ return a->Milliseconds == b->Milliseconds;
+ }
+
+ static bool operator != (Duration ^ a, Duration ^ b)
+ {
+ return a->Milliseconds != b->Milliseconds;
+ }
+};
public ref class DurationConstants sealed
{
|