Closed jagerman closed 3 years ago
uvw::Handle
is an intermediary class template, so we can't really use it here.
However, the default case is only for when no uvw::*Handle
class is attached to the underlying handle.
In what case is it returning a uv_handle_t
exactly? Is it something not managed by uvw
itself?
It isn't actually making it into that code path, but because of the default:
case it needs to compile for it anyway.
Aha got it. Well, probably we should get rid of it and only return handles that are managed by uvw
. Actually, we should also check that handle->data
is set, because it could be not for handles created by users.
Attempting to do:
as per the README fails to compile because the default case in
Loop::walk
invokes the callback with theuv_handle_t*
, and so:I can work around it with something like
if constexpr (!std::is_pointer_v<std::remove_reference_t<decltype(h)>>) h.close();
, but perhaps that fallback case should wrap in a genericuvw::Handle
argument instead of passing the bare pointer?