Skip to content

Instantly share code, notes, and snippets.

@vinipsmaker
Created January 31, 2014 19:34
Show Gist options
  • Save vinipsmaker/8741336 to your computer and use it in GitHub Desktop.
Save vinipsmaker/8741336 to your computer and use it in GitHub Desktop.
// taken from http://isocpp.org/files/papers/N3858.pdf
future<int> f(stream str) resumable
{
shared_ptr<vector<char>> buf = ...;
int count = await str.read(512, buf);
return count + 11;
}
future<void> g() resumable
{
stream s = ...;
int pls11 = await f(s);
s.close();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment