Highlights
C++ coroutines: The problem of the DispatcherQueue task that runs too soon, part 1 | The Old New Thing | devblogs.microsoft.com
I was experiencing occasional crashes in C++/WinRT’s resume_foreground function when it tries to resume execution on a dispatcher queue. Here’s a simplified version of that function: auto resume_foreground(DispatcherQueue const& dispatcher) { struct awaitable { DispatcherQueue m_dispatcher; bool m_queued = false; bool await_ready() { return false;
more...
Article Raymond Chen CPP Dec 23, 2019 1  
C++ coroutines: The problem of the synchronous apartment-changing callback | The Old New Thing | devblogs.microsoft.com
Today is a puzzle you can you can try to solve with the information you’ve learned about C++ coroutines and C++/WinRT. C++/WinRT uses the IContext­Callback interface to remember the context that initiated a co_await operation, so it can resume execution in the original apartment when the co_await completes.
more...
Article Raymond Chen CPP Dec 21, 2019 1  
C++ coroutines: The co_await operator and the function search algorithm | The Old New Thing | devblogs.microsoft.com
So you’re following along Kenny Kerr’s blog and you get to the part where he uses co_await on a time duration: co_await 5s; so you try it: #include <chrono> using namespace std::chrono; winrt::IAsyncAction Delay10Seconds() { co_await 10s; co_return; } and you get the error message no callable ‘await_resume’
more...
Article Raymond Chen CPP Dec 20, 2019 1  
C++ coroutines: Defining the co_await operator | The Old New Thing | devblogs.microsoft.com
At the start of this series, I noted that there are three steps in obtaining an awaiter for an awaitable object. The first two were marked “We’re not read to talk about this yet.” Well, now we’re ready to talk about one of them.
more...
Article Raymond Chen CPP Dec 19, 2019 1  
Debugging Linux CMake Projects with gdbserver | C++ Team Blog | devblogs.microsoft.com
Gdbserver is a program that allows you to remotely debug applications running on Linux. It is especially useful in embedded scenarios where your target system may not have the resources to run the full gdb. Visual Studio 2019 version 16.5 Preview 1 enables remote debugging of CMake projects with gdbserver.
more...
Article Erika Sweet CPP Dec 19, 2019 1  
C++ coroutines: no callable 'await_resume' function found for type | The Old New Thing | devblogs.microsoft.com
You try to co_await something and get the error message no callable ‘await_resume’ (or ‘await_ready’ or ‘await_suspend’) function found for type ‘Expression’ What does this mean? Recall how the compiler generates code for co_await:   calculate x obtain awaiter co_await if (!awaiter.await_ready()) { save state for resumption if (awaiter.await_suspend(handle)) { return to caller [Invoking the handle resumes execution here] } restore state after resumption } result = awaiter.await_resume();
more...
Article Raymond Chen CPP Dec 18, 2019 1  
Build C++ Applications in a Linux Docker Container with Visual Studio | C++ Team Blog | devblogs.microsoft.com
Docker containers provide a consistent development environment for building, testing, and deployment. The virtualized OS, file system, environment settings, libraries, and other dependencies are all encapsulated and shipped as one image that can be shared between developers and machines. This is especially useful for C++ cross-platform developers because you can target a container that runs a different operating system than the one on your development machine.
more...
Article Erika Sweet CPP Dec 14, 2019 1  
C++ coroutines: Short-circuiting suspension, part 1 | The Old New Thing | devblogs.microsoft.com
At the start of this series, I gave the basic idea for how the compiler generates code for co_await, but I left out some details for expository simplicity. There are some mysterious steps called “We’re not ready to talk about this step yet.”
more...
Article Raymond Chen CPP Dec 13, 2019 1  
C++ coroutines: Awaiting an IAsyncAction without preserving thread context | The Old New Thing | devblogs.microsoft.com
The C++/WinRT library provides an awaiter for Windows Runtime asynchronous activities. Those asynchronous activities are represented by IAsync­Action, IAsync­Operation, and progress versions of the above. The C++/WinRT-provided awaiter resumes execution of the caller in the same COM apartment that awaited the activity.
more...
Article Raymond Chen CPP Dec 12, 2019 1  
C++ coroutines: Framework interop | The Old New Thing | devblogs.microsoft.com
So far, we’ve been looking at the basics of awaitable objects. Even though we barely know anything beyond await_suspend, we already know enough to allow us to start diving deeper. It is frequently the case that you need your awaiter to interact with something outside the C++ standard library.
more...
Article Raymond Chen CPP Dec 11, 2019 1  
C++ coroutines: Getting started with awaitable objects – The Old New Thing | devblogs.microsoft.com
C++ coroutines: Getting started with awaitable objects – The Old New Thing
more...
Article Raymond Chen CPP Dec 09, 2019 1  
A Free Ebook on C++ Smart Pointers - Fluent C++ | fluentcpp.com
C++ Smart Pointers: A free ebook that contains the basic, medium and advanced aspects of C++ smart pointers.
more...
Article Jonathan Boccara CPP Dec 25, 2018 1  

Featured Contributors

Jonathan Boccara
CPP ~   ..
Raymond Chen
CPP ~   ..