For years I’ve been programming in C++ with the belief that the bodies of template methods had to be in headers. Only recently I learned that splitting template methods between header and source is, in fact, often perfectly fine.
Ever been criticised for using totally working C code in a C++ codebase just because it wasn’t proper C++? Here’s why you shouldn’t have done it.
If you follow these steps, you might learn to write things normally impossible to do in compile time, such as self-registering factory.
C++20 allows writing functions that suspend and can continue at the next line. This has an amazing application at avoiding writing annoying and error-prone state machines. This article showcases how coroutines can clean up a function that would usually need an ugly state machine.
Prologue and motivation A part of my PhD. research deals with computer science as a source of innovative ways to…
I’ve recently gained interest in OpenCV. The problem with this is, that in most modern tutorials and walkthroughs it seems…
Vector can find elements in linear time, hashtable in constant time. That’s a pretty elementary part of computer science. However, better complexity does not always mean it’s faster.
How about defining the variable, initialising it and writing code for serialisation and deserialisation on a single line of code?
It’s somewhat annoying that a factory needs to depend on all classes that inherit from the common interface. This issue can be avoided using a self-registering factory.
C++ has a bad reputation for long times needed for development. However, as this task has shown, it does not deserve this reputation.