From 3916dc4c7309d7c71123eb7dd08a9f12f30c1727 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@1096898 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/bindings/qpid/dotnet/src/Duration.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'qpid/cpp') diff --git a/qpid/cpp/bindings/qpid/dotnet/src/Duration.h b/qpid/cpp/bindings/qpid/dotnet/src/Duration.h index 213c338a59..d4239fae88 100644 --- a/qpid/cpp/bindings/qpid/dotnet/src/Duration.h +++ b/qpid/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