mirror of
https://github.com/matrix-construct/construct
synced 2024-06-02 18:18:56 +02:00
ircd::db: Add nothrow column construction overload.
This commit is contained in:
parent
4ded053406
commit
918bc95d1a
|
@ -149,6 +149,7 @@ struct ircd::db::column
|
|||
|
||||
column(database::column &c);
|
||||
column(database &, const string_view &column);
|
||||
column(database &, const string_view &column, const std::nothrow_t);
|
||||
column() = default;
|
||||
};
|
||||
|
||||
|
|
29
ircd/db.cc
29
ircd/db.cc
|
@ -10079,15 +10079,36 @@ ircd::db::has(column &column,
|
|||
// column
|
||||
//
|
||||
|
||||
ircd::db::column::column(database::column &c)
|
||||
:c{&c}
|
||||
ircd::db::column::column(database &d,
|
||||
const string_view &column_name,
|
||||
const std::nothrow_t)
|
||||
:c{[&d, &column_name]
|
||||
{
|
||||
const int32_t cfid
|
||||
{
|
||||
d.cfid(std::nothrow, column_name)
|
||||
};
|
||||
|
||||
return cfid >= 0?
|
||||
&d[cfid]:
|
||||
nullptr;
|
||||
}()}
|
||||
{
|
||||
}
|
||||
|
||||
ircd::db::column::column(database &d,
|
||||
const string_view &column_name)
|
||||
:c{&d[column_name]}
|
||||
{}
|
||||
:column
|
||||
{
|
||||
d[column_name]
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
ircd::db::column::column(database::column &c)
|
||||
:c{&c}
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
ircd::db::column::operator()(const delta &delta,
|
||||
|
|
Loading…
Reference in a new issue