Tag
The article discusses techniques in C++ to enforce derived classes to implement a specific non-virtual method, using examples from C++/WRL and C++/WinRT, and critiques a code review scenario where comments were used instead of proper enforcement.
Raymond Chen explains how to use std::unique_ptr to manage a registration cookie in a fake agile wrapper, discussing integer-to-pointer round-tripping and the wil::unique_any alternative.
Raymond Chen continues his series on creating a fake agile wrapper for non-marshalable COM objects by wrapping them in a marshalable object, enabling registration in the global interface table while preserving undefined-behavior-free failures in other apartments.
This article continues a series on implementing agile delegates in C++/WinRT, addressing the issue of destructing non-agile delegates in the correct context using a custom deleter and IContextCallback.
The article discusses a C++/WinRT pattern for caching the result of a Windows Runtime IAsyncOperation, including handling failures, so that multiple coroutines can share the cached result or exception.