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

ircd::iov: Support default construction and nullification.

This commit is contained in:
Jason Volk 2017-09-12 09:38:51 -07:00
parent ed9a8691c4
commit 6fb3b44c05

View file

@ -57,11 +57,12 @@ template<class T>
struct ircd::iov<T>::node
:iov::list_node
{
iov &i;
iov *const i {nullptr};
operator const T &() const;
operator T &();
node() = default;
template<class... args> node(iov &, args&&...);
node(node &&) = delete;
node(const node &) = delete;
@ -74,7 +75,7 @@ template<class T>
template<class... args>
ircd::iov<T>::node::node(iov &iov,
args&&... a)
:i{iov}
:i{&iov}
{
auto &list
{
@ -99,7 +100,7 @@ template<class T>
ircd::iov<T>::node::~node()
noexcept
{
i.remove_if([this](const T &x)
i->remove_if([this](const T &x)
{
return &x == &static_cast<const T &>(*this);
});