skypjack / uvw

Header-only, event based, tiny and easy to use libuv wrapper in modern C++ - now available as also shared/static library!
MIT License
1.82k stars 207 forks source link

Fix compile errors caused by ambiguous naming of poll_event in poll_handle #281

Closed ReimuNotMoe closed 1 year ago

ReimuNotMoe commented 1 year ago

The line

using poll_event = details::uvw_poll_event;

created an ambiguous alias with the same name as the struct poll_event.

And poll_handle should be inheriting handle<poll_handle, uv_poll_t, poll_event> instead of handle<poll_handle, uv_poll_t, details::uvw_poll_event> if I'm understanding correctly. Otherwise on<uvw::poll_event>() doesn't work.

skypjack commented 1 year ago

You're definitely right on handle<poll_handle, uv_poll_t, details::uvw_poll_event>. 👍 On the other hand, I'd rather change the using declaration to 🤔 poll_event_flags (we used a similar pattern somewhere else too) and use it in the class. I don't like using details::xxx names in an API, it's odd and somewhat risky.

Do you mind updating the PR?

ReimuNotMoe commented 1 year ago

You're definitely right on handle<poll_handle, uv_poll_t, details::uvw_poll_event>. +1 On the other hand, I'd rather change the using declaration to thinking poll_event_flags (we used a similar pattern somewhere else too) and use it in the class. I don't like using details::xxx names in an API, it's odd and somewhat risky.

Do you mind updating the PR?

Of course I don't mind.