In this article, I’m going to talk about some practical uses, practical motivations, and common misunderstanding for move semantics. I’ve seen a lot of posts talk about move semantics in a very contrived way, and I’m here to make things more practical. If you’re a beginner to move semantics check…

In this article, we’re going to dive deep into how C++ inheritance looks in memory and how polymorphism works under the hood. This is not an article on best practices and motivations for inheritance, but rather how C++ makes such powerful and fast inheritance tools.

Let’s start with single inheritance.

Photo by Alexandre Debiève on Unsplash

Let’s talk about all the complex things that go into actually executing simple C++ code. We’re going to talk about memory, compilers, assembly code, and more, so buckle down and let’s see how this executes.

struct A {
public:
A(int _a, char _b, double _c): a(_a), b(_b), c(_c) {}…

When you use queues in a concurrent program, you would usually synchronize push and pop functions with locks. You’d lock before pushing or popping and unlock right before the function ends. However, locking comes with some overhead in both creating and acquiring them, so it would be amazing if we…

The std::unordered_map in C++ standard library is a really powerful data structure offering insertion, deletion, and lookup in O(1) amortized time. std::unordered_map is implemented as a hashmap or hashtable which are the same thing. …

Paxos Islands

Recent archaeological discoveries on the island of Paxos reveal that the parliament functioned despite the peripatetic propensity of its part-time legislators. The legislators maintained consistent copies of the parliamentary record, despite their frequent forays from the chamber and the forgetfulness of their messengers. …

Josh Segal

C/C++ | Computer Systems | Low Latency | Distributed Systems | Computer Networks | Operating Systems

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store