0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-03-14 05:20:17 +01:00

ircd::db: Add nothrow overloads to the column viewer.

This commit is contained in:
Jason Volk 2018-01-27 10:07:08 -08:00
parent b97b00bf0d
commit b926e6b42d
2 changed files with 25 additions and 0 deletions

View file

@ -127,6 +127,8 @@ struct ircd::db::column
// [GET] Perform a get into a closure. This offers a reference to the data with zero-copy.
using view_closure = std::function<void (const string_view &)>;
bool operator()(const string_view &key, std::nothrow_t, const view_closure &func, const gopts & = {});
bool operator()(const string_view &key, std::nothrow_t, const gopts &, const view_closure &func);
void operator()(const string_view &key, const view_closure &func, const gopts & = {});
void operator()(const string_view &key, const gopts &, const view_closure &func);

View file

@ -3762,6 +3762,29 @@ ircd::db::column::operator()(const string_view &key,
func(val(*it));
}
bool
ircd::db::column::operator()(const string_view &key,
const std::nothrow_t,
const gopts &gopts,
const view_closure &func)
{
return operator()(key, std::nothrow, func, gopts);
}
bool
ircd::db::column::operator()(const string_view &key,
const std::nothrow_t,
const view_closure &func,
const gopts &gopts)
{
const auto it(seek(*this, key, gopts));
if(!valid_eq(*it, key))
return false;
func(val(*it));
return true;
}
ircd::db::cell
ircd::db::column::operator[](const string_view &key)
const