Uses of Parser Generators
We tend to think of parser generators as being used to implement the front-end of a programming language compiler, and having graduated from writing the desk-calculator program this is typically what...
View ArticleUnderstanding Iterator Invalidation
As introduced in the Tutorial on this site, practising correct use of iterators is essential for correct and efficient use of the Standard Containers. This article aims to uncover the details of...
View ArticleRange-for enhancements in C++23
The latest C++ Standard has been with us for a while now, and in this article we’re going to take a look at a couple of useful enhancements to the range-for syntax we’ve used since C++11. Iterating...
View ArticlePattern Matching is coming to Modern C++
Pattern matching is a commonly used idiom in other contemporary programming languages, such as Rust or Haskell, and is a way to inspect and deconstruct value(s) based on their type(s). Unlike...
View ArticleHow could Reflection be applied to Modern C++?
Reflection is commonplace in other contemporary programming languages, but support for it in C++ is virtually non-existent. In this article we’re going to summarize what reflection is and how existing...
View ArticleMaking algorithms faster
It is possible to write poor-quality code in any programming language, and this often stems from sub-optimal algorithms being used. Most of the execution time in modern software is spent in loops, so...
View ArticleWhen to use std::string_view
C++17 brought us the class std::string_view in the standard library, which was touted as a lightweight, non-owning string-like entity which could be passed cheaply as a function parameter. In this...
View ArticleC++ Concurrency 101
Utilizing the potential of multi-core CPUs as found in virtually all modern hardware can only be achieved by writing multi-threaded programs. Code which is multi-threaded allows multiple threads to run...
View ArticleAdditional Unicode support in C++
Unicode is so prevalent these days that it is difficult to imagine any modern programming language not supporting it. C++ has made a number of attempts to provide language and library support for...
View ArticleOperator Overloading in Modern C++ (1)
OO (or OOP) has previously been commonly used to mean “Object-Oriented (Programming)”, but there is another use of the acronym OO which is: “Operator Overloading”. Simply put this involves creating...
View ArticleOperator Overloading in Modern C++ (2)
Having looked at how to create a class representing a three-dimensional vector in the previous article, we’re going to look at how to add more operator-related functionality to it. We’ll start off with...
View ArticleOperator Overloading in Modern C++ (3)
Having looked at how to overload common math operators in previous articles, in this article we’re going to look at how to overload some “special” operators (unary * and ->) as well as increment and...
View ArticleMove Semantics in Modern C++ (1)
The title for this mini-series may seem to be ambitious for two reasons: move semantics have been available for a long time (since C++11 in fact, so not very “Modern”), and it is a large subject (there...
View ArticleMove Semantics in Modern C++ (2)
Now that we’ve looked at how std::move() can be applied to Standard Library types, such as std::string, in this article we’re going to look at creating our own “move-aware” type. We want it to have at...
View ArticleMove Semantics in Modern C++ (3)
In the previous two articles we looked at how to transfer “move-aware” objects, such as std::string, between variables, and also how to create a Movable class which logs all copy and move operations...
View Article