Files
Rediska/rediska/common/utils.hpp
Nikita Astafyev 35a6349071
Some checks failed
Code Analysis / analysis (push) Failing after 2m59s
chore: initial commit
2025-12-30 22:34:58 +07:00

25 lines
800 B
C++

#pragma once
#include <type_traits>
#include "rediska/common/types.hpp"
template<typename T, typename... Ts>
constexpr bool is_any_of_v = (std::is_same_v<T, Ts> || ...);
inline RediskaReturnCode DSReturnCodeToRediskaReturnCode(DSReturnCode code) {
switch (code) {
case DSReturnCode::OK:
return RediskaReturnCode::OK;
case DSReturnCode::NOT_FOUND:
return RediskaReturnCode::NOT_FOUND;
case DSReturnCode::INCOMPATIBLE_OPERATION:
return RediskaReturnCode::INCOMPATIBLE_OPERATION;
case DSReturnCode::EMPTY:
return RediskaReturnCode::DS_EMPTY;
case DSReturnCode::OUT_OF_RANGE:
return RediskaReturnCode::DS_OUT_OF_RANGE;
default:
return RediskaReturnCode::UNKNOWN_ERROR;
}
}