C++
2024
2018
C++ Bit Fields
C++ allows you to pack bit fields. This isn’t something I’ve used as it seems to have some very specific use cases and is platform dependent (also see bit field notes).
Modern CMake
From Stephen Kelly’s YouTube video and blog link, a quick overview of modern, reusable CMake: what we should use, and what we should not, for composable and terse CMake.
2013
std::unique_ptr usage
If you’re new to C++11, this post on Stackoverflow answers the question “How do I pass a unique_ptr
argument to a constructor or a function?” going through each case:
- by value
- by non-const l-value reference
- by const l-value reference
- by r-value reference
async and await in C++
I’ve just watched Herb Sutter‘s talk on C++ in Visual Studio 2013 and onwards.
The last quarter of the talk was concerned with Microsoft introducing the __async
and __await
keywords in a similar implementation to that already used in C#, note the __
prefix.
As he explained, this is going to be an implementation of a proposed feature for inclusion in a future version of C++, much like the modules feature currently being implemented in CLang.
The Visual Studio roadmap was intertesting, but it looks like we’re going to have to wait a while for generic lambdas.