memcat: fix #59 (typo) [ci skip]
[awesomized/libmemcached] / libtest / memcached.hpp
index c4953975817bdf66201aaa5b2cd028ec590d79a5..5d010faf82704189f55d58dbcc8314495b71bfc3 100644 (file)
@@ -39,7 +39,7 @@
 #if defined(HAVE_LIBMEMCACHED) && HAVE_LIBMEMCACHED
 inline bool operator== (const memcached_st& memc, const memcached_return_t rc)
 {
-  if (memcached_last_error(&memc) == rc)
+  if (memcached_last_error(const_cast<memcached_st *>(&memc)) == rc)
   {
     return true;
   }
@@ -47,9 +47,9 @@ inline bool operator== (const memcached_st& memc, const memcached_return_t rc)
   return false;
 }
 
-inline bool operator!= (const memcached_st& memc, const memcached_return_t rc)
+inline bool operator!= (const memcached_st& memc, memcached_return_t rc)
 {
-  if (memcached_last_error(&memc) != rc)
+  if (memcached_last_error(const_cast<memcached_st *>(&memc)) != rc)
   {
     return true;
   }
@@ -57,9 +57,39 @@ inline bool operator!= (const memcached_st& memc, const memcached_return_t rc)
   return false;
 }
 
-inline bool operator!= (const memcached_return_t rc, const memcached_st& memc)
+inline bool operator== (memcached_st* const memc, memcached_return_t rc)
 {
-  if (memcached_last_error(&memc) != rc)
+  if (memcached_last_error(memc) == rc)
+  {
+    return true;
+  }
+
+  return false;
+}
+
+inline bool operator!= (memcached_st* const memc, memcached_return_t rc)
+{
+  if (memcached_last_error(memc) != rc)
+  {
+    return true;
+  }
+
+  return false;
+}
+
+inline bool operator!= (memcached_return_t rc, const memcached_st& memc)
+{
+  if (memcached_last_error(const_cast<memcached_st *>(&memc)) != rc)
+  {
+    return true;
+  }
+
+  return false;
+}
+
+inline bool operator!= (memcached_return_t rc, memcached_st* const memc)
+{
+  if (memcached_last_error(memc) != rc)
   {
     return true;
   }