mirror of
https://github.com/matrix-construct/construct
synced 2025-03-13 21:10:32 +01:00
ircd::db: Add nothrow overloads to the column viewer.
This commit is contained in:
parent
b97b00bf0d
commit
b926e6b42d
2 changed files with 25 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
23
ircd/db.cc
23
ircd/db.cc
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue