Tag Archives: c++17
Reflection for aggregates
An aggregate is an array or a class with no user-declared or inherited constructors, no private or protected direct non-static data members, no virtual functions, and no virtual, private, or protected base classes. Aggregates can be initialized in aggregate initialization, … Continue reading
Deducing your intentions
The language feature in C++17 known as class template argument deduction was intended to supersede factory functions like make_pair, make_tuple, make_optional, as described in p0091r2. This goal has not been fully achieved and we may still need to stick to … Continue reading
Rvalues redefined
In this post we will explore what I consider the most significant language change in C++17. I call it the most significant because it changes the way you design your resource-managing types and how you think about initialization. It is … Continue reading
Help the compiler warn you
Compiler warnings are a very useful tool for detecting bugs in your program. Because you can enable them selectively, and because you can choose to turn them into hard errors on your compiler, you can in fact build a dialect, … Continue reading
Compile-time string concatenation
We will start with a bug, taken from real life. It spans across three files: Question: what happens when this program is executed?
Clever overloading
This post is intended to be a light introduction to certain C++ guru tricks. I want to introduce a couple of concepts that typically put normal people off. If you are an expert you will probably not learn anything new, … Continue reading