From e2147e00b4120d4285ebcfaa9d97817c7fdc7600 Mon Sep 17 00:00:00 2001 From: "Charles E. Rolke" Date: Tue, 26 Apr 2011 20:38:06 +0000 Subject: 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 --- cpp/bindings/qpid/dotnet/src/Duration.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'cpp') 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 { -- cgit v1.2.1