diff --git a/src/reply.cpp b/src/reply.cpp index c3aaf2a..eb2be05 100644 --- a/src/reply.cpp +++ b/src/reply.cpp @@ -79,10 +79,22 @@ namespace redis { return get_error_string(parReply); } + template <> + const StatusString& get (const Reply& parReply) { + static const char empty_str[1] = ""; + static const StatusString empty_status(empty_str, 0); + if (parReply.is_nil()) + return empty_status; + + assert(parReply.is_status()); + return boost::get(parReply); + } + template const std::string& get ( const Reply& parReply ); template const std::vector& get> ( const Reply& parReply ); template const long long& get ( const Reply& parReply ); template const ErrorString& get ( const Reply& parReply ); + template const StatusString& get ( const Reply& parReply ); bool Reply::is_integer() const { return RedisVariantType_Integer == this->which();