[vlc-commits] npapi: utils: Variant: Allow comparison operations

Hugo Beauzée-Luyssen git at videolan.org
Tue Apr 21 10:15:55 CEST 2015


npapi-vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Wed Mar 25 15:17:37 2015 +0100| [c99183fe39a532c6c259782de00c57d02d6d69a3] | committer: Hugo Beauzée-Luyssen

npapi: utils: Variant: Allow comparison operations

> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=c99183fe39a532c6c259782de00c57d02d6d69a3
---

 npapi/utils.hpp |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/npapi/utils.hpp b/npapi/utils.hpp
index 56d6805..0310297 100644
--- a/npapi/utils.hpp
+++ b/npapi/utils.hpp
@@ -412,6 +412,30 @@ public:
         return &m_variant;
     }
 
+    template <typename T>
+    bool operator<(const T& rhs) const
+    {
+        return (const T)*this < rhs;
+    }
+
+    template <typename T>
+    bool operator<=(const T& rhs) const
+    {
+        return (const T)*this <= rhs;
+    }
+
+    template <typename T>
+    bool operator>(const T& rhs) const
+    {
+        return (const T)*this > rhs;
+    }
+
+    template <typename T>
+    bool operator>=(const T& rhs) const
+    {
+        return (const T)*this >= rhs;
+    }
+
     ~Variant()
     {
         release();



More information about the vlc-commits mailing list