Skip to content

Commit

Permalink
[rocksdb] static_assert
Browse files Browse the repository at this point in the history
Signed-off-by: kuvaldini <[email protected]>
  • Loading branch information
kuvaldini committed Jul 27, 2021
1 parent 76b8a84 commit 57da233
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions irohad/ametsuchi/impl/rocksdb_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,8 @@ namespace iroha::ametsuchi {
template <typename RetT, kDbOperation kOp, kDbEntry kSc, typename... Args>
inline expected::Result<std::optional<RetT>, DbError> dbCall(
RocksDbCommon &common, Args &&... args) {
static_assert(kOp != kDbOperation::kDel or kSc == kDbEntry::kCanExist,
"Delete operation does not report if key existed before deletion!");
auto status = executeOperation<kOp, kSc>(
common,
[&] { return fmt::format(std::forward<Args>(args)...); },
Expand Down

0 comments on commit 57da233

Please sign in to comment.