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.85k stars 209 forks source link

Error in code snippet #187

Closed escherstair closed 4 years ago

escherstair commented 4 years ago

The code snippet in The event-based approach has an error in the second line:

auto loop = uvw::Loop::getDefault();
auto tcp = loop.resource<uvw::TCPHandle>();

Since loop is a shared_ptr<>, the second line should be auto tcp = loop->resource<uvw::TCPHandle>();