jimspr / awaituv Goto Github PK
View Code? Open in Web Editor NEWAdapters for interfacing libuv with C++ resumable functions
License: MIT License
Adapters for interfacing libuv with C++ resumable functions
License: MIT License
I tried to compile with Clang 10 but failed. It seems the suspend_if
is not part of the coroutine
standard.
Consider following code:
{
fs_t req; // Free uninitialized pointers
}
{
fs_t req;
uv_fs_open(loop, &req, ...); // init req
return req; // Req is copied, which results in req being freed twice
}
The second possibility is rather harder to found because compilers may apply NRVO ( but not always true).
In order to make fs_t
safe to use, you have to initialize fs_t
always ( for example memset(0) ) and make it non-copyable ( movable only ). I'd rather suggest not defining these types in global headers. Move them to samples and let users choose.
I tried to compile with Clang 10 but failed. It seems the suspend_if
is not part of the coroutine
standard.
async/await + libuv, awesome! How about create a vcpkg port here:
https://github.com/microsoft/vcpkg
and we can use awaituv by just typing:
vcpkg install awaituv
that would be cool.
Is there any way to use co_await when targetting linux w/ VC++?
Hi Jim,
Apologies for the off topic issue, don't have your email.
Within the latest clang 8, is it possible to get experimental coroutines working for webassembly?
/Downloads/awaituv-master/inc/awaituv.h:335:22: error: no type named 'suspend_if' in namespace 'std::experimental'
std::experimental::suspend_if initial_suspend() const
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.