From a9de3643f4beee6be84aadef5b2b14d0895253ee Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Wed, 14 Jun 2017 23:56:57 +0100 Subject: [PATCH] DEL returns an integer, it seems. --- include/incredis/incredis.hpp | 10 +++++----- src/incredis.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/incredis/incredis.hpp b/include/incredis/incredis.hpp index 14e1f60..c37c00d 100644 --- a/include/incredis/incredis.hpp +++ b/include/incredis/incredis.hpp @@ -72,7 +72,7 @@ namespace redis { opt_string_list hmget ( boost::string_view parKey, Args&&... parArgs ); template bool hmset ( boost::string_view parKey, Args&&... parArgs ); - int hincrby ( boost::string_view parKey, boost::string_view parField, int parInc ); + RedisInt hincrby ( boost::string_view parKey, boost::string_view parField, int parInc ); //Set opt_string_list srandmember ( boost::string_view parKey, int parCount ); @@ -90,7 +90,7 @@ namespace redis { RedisInt dbsize ( void ); bool expire ( boost::string_view parKey, RedisInt parTTL ); template - bool del (Args&&... parArgs); + RedisInt del (Args&&... parArgs); //String opt_string get ( boost::string_view parKey ); @@ -118,10 +118,10 @@ namespace redis { } template - bool IncRedis::del (Args&&... parArgs) { + RedisInt IncRedis::del (Args&&... parArgs) { static_assert(sizeof...(Args) > 0, "No keys specified"); - const auto ret = redis::get(m_command.run("DEL", std::forward(parArgs)...)); - return ret.is_ok(); + const auto ret = m_command.run("DEL", std::forward(parArgs)...); + return get_integer(ret); } } //namespace redis diff --git a/src/incredis.cpp b/src/incredis.cpp index 19c8d2a..f2f319b 100644 --- a/src/incredis.cpp +++ b/src/incredis.cpp @@ -101,7 +101,7 @@ namespace redis { return optional_string(m_command.run("HGET", parKey, parField)); } - int IncRedis::hincrby (boost::string_view parKey, boost::string_view parField, int parInc) { + RedisInt IncRedis::hincrby (boost::string_view parKey, boost::string_view parField, int parInc) { const auto inc = dhandy::lexical_cast(parInc); auto reply = m_command.run("HINCRBY", parKey, parField, inc); return get_integer(reply);