X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fmemcached.hpp;h=142f167c31398bec78d87e2272fbd43d65b93b86;hb=7d5121e0a421d3efae7661049c436bd5a8e193e0;hp=c4953975817bdf66201aaa5b2cd028ec590d79a5;hpb=89577febff3909fe3498c40699aae8f933c122c0;p=awesomized%2Flibmemcached diff --git a/libtest/memcached.hpp b/libtest/memcached.hpp index c4953975..142f167c 100644 --- a/libtest/memcached.hpp +++ b/libtest/memcached.hpp @@ -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(&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(&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; }