> 348 + release_fn(std::move(other.release_fn))
> 367 + if (release_fn)
>
> Unfortunately the standard says that move-constructing a std::function from
> another std::function leaves the latter in a valid but unspecified state. So
> "if (release_fn)" in the destructor is not guaranteed to be false after the
> move.
That's so weird. I guess you could use other.swap(release_fn) in the constructor body instead. I hope that's well defined :)
> 348 + release_ fn(std: :move(other. release_ fn))
> 367 + if (release_fn)
>
> Unfortunately the standard says that move-constructing a std::function from
> another std::function leaves the latter in a valid but unspecified state. So
> "if (release_fn)" in the destructor is not guaranteed to be false after the
> move.
That's so weird. I guess you could use other.swap( release_ fn) in the constructor body instead. I hope that's well defined :)