From 91862e381f99c39f93a699f10e2d804b488cc21d Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 30 Aug 2019 21:32:02 -0700 Subject: [PATCH] ircd::m: Add additional query() convenience template. --- include/ircd/m/query.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/ircd/m/query.h b/include/ircd/m/query.h index a8f454f1a..df14129f2 100644 --- a/include/ircd/m/query.h +++ b/include/ircd/m/query.h @@ -15,6 +15,8 @@ namespace ircd::m { template R query(std::nothrow_t, const event::idx &, const string_view &key, R&& def, const std::function &); template auto query(std::nothrow_t, const event::idx &, const string_view &key, F&&); + + template R query(const event::idx &, const string_view &key, R&& def, F&&); template auto query(const event::idx &, const string_view &key, F&&); } @@ -41,6 +43,17 @@ ircd::m::query(const event::idx &event_idx, return ret; } +template +R +ircd::m::query(const event::idx &event_idx, + const string_view &key, + R&& r, + F&& f) +{ + return query(std::nothrow, event_idx, key, std::forward(r), std::forward(f)); +} + /// See other overload documentation first. This overload implements /// non-throwing behavior when the event_idx/key(column) is not found by /// calling the closure with a default-constructed string so the closure can