0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 02:02:38 +01:00

ircd: Mark recommended noexcept on inline constructors.

This commit is contained in:
Jason Volk 2019-06-22 17:11:41 -06:00
parent 534afe8859
commit 7aaee4c68d
7 changed files with 15 additions and 6 deletions

View file

@ -577,7 +577,7 @@ struct ircd::allocator::node<T>::allocator
auto address(const_reference x) const { return &x; }
template<class U, class... args>
void construct(U *p, args&&... a)
void construct(U *p, args&&... a) noexcept
{
new (p) U(std::forward<args>(a)...);
}

View file

@ -34,6 +34,7 @@ struct ircd::db::database::events final
void OnStallConditionsChanged(const rocksdb::WriteStallInfo &) noexcept override;
events(database *const &d)
noexcept
:d{d}
{}
};

View file

@ -28,7 +28,9 @@ struct ircd::db::database::prefix_transform final
bool InRange(const Slice &key) const noexcept override;
Slice Transform(const Slice &key) const noexcept override;
prefix_transform(database *const &d, db::prefix_transform user)
prefix_transform(database *const &d,
db::prefix_transform user)
noexcept
:d{d}
,user{std::move(user)}
{}

View file

@ -58,19 +58,21 @@ struct ircd::net::wait_opts
-1
};
wait_opts(const ready &, const milliseconds &timeout);
wait_opts(const ready &);
wait_opts(const ready &, const milliseconds &timeout) noexcept;
wait_opts(const ready &) noexcept;
wait_opts() = default;
};
inline
ircd::net::wait_opts::wait_opts(const ready &type)
noexcept
:type{type}
{}
inline
ircd::net::wait_opts::wait_opts(const ready &type,
const milliseconds &timeout)
noexcept
:type{type}
,timeout{timeout}
{}

View file

@ -182,6 +182,7 @@ struct ircd::string_view
{}
string_view(const std::string &string)
noexcept
:string_view{string.data(), string.size()}
{}

View file

@ -23,6 +23,7 @@
#define IRCD_UNIT_LITERAL_UL(name, morphism) \
constexpr auto \
operator"" _ ## name(const unsigned long long val) \
noexcept \
{ \
return (morphism); \
}
@ -32,6 +33,7 @@ operator"" _ ## name(const unsigned long long val) \
#define IRCD_UNIT_LITERAL_LL(name, morphism) \
constexpr auto \
operator"" _ ## name(const long long val) \
noexcept \
{ \
return (morphism); \
}
@ -41,6 +43,7 @@ operator"" _ ## name(const long long val) \
#define IRCD_UNIT_LITERAL_LD(name, morphism) \
constexpr auto \
operator"" _ ## name(const long double val) \
noexcept \
{ \
return (morphism); \
}

View file

@ -488,8 +488,8 @@ noexcept
// net/wait.h
//
ircd::net::wait_opts
const ircd::net::wait_opts_default;
decltype(ircd::net::wait_opts_default)
ircd::net::wait_opts_default;
/// Wait for socket to become "ready" using a ctx::future.
ircd::ctx::future<void>