Who
Aaron Ballman is a Principal Compiler Engineer for Intel and is the lead maintainer of the Clang open source compiler. He has two decades of experience writing cross-platform frameworks in C/C++, compiler & language design, and software engineering best practices and is currently a voting member of the C (WG14) and C++ (WG21) standards committees.
In case you can't figure it out easily enough, the views expressed here are my personal views and not the views of my employer, my past employers, my future employers, or some random person on the street. Please yell only at me if you disagree with what you read.
Search
Category Archives: C/C++
Contextual Keywords
I believe the C++ standards committee got some things wrong in the distant past. Converting constructors work implicitly with an assignment operation, function hiding and overriding are not explicit, there’s no way to prevent a subclass from providing further overrides … Continue reading
Understanding Attributes
The new C++11 standard includes the ability to specify “attributes” for various declarations. The concept of attributes will be familiar to you if you’ve done work in languages like C# or Java. However, there are major differences between C++ attributes … Continue reading
When to be Explicit
In C++, a constructor that accepts a single parameter non-defaulted parameter is also considered a converting constructor. Converting constructors allow you to initialize a class instance using that single parameter type either via explicit construction, or via an assignment construction. … Continue reading
What I Learned Today About Virtual Functions
What is wrong with the following class declarations? It turns out that the correct definition is the one to Bar, which came as a surprise to me.
Static Polymorphism in C++
One of my coworkers recently asked me to help him solve a problem he was having in code. He had a base class with several derived classes, and he wanted to add a static method to the base class, but … Continue reading
Crashing: Easy to Do When You Don’t Want to, Hard When You Do
The challenge: in C or C++, come up with a way to crash your application, running as little code as possible. It should be a cross-platform solution that works with any compiler, on any system, with any CPU architecture.
List Initialization
One of the new features in C++0x has been to make a consistent mechanism for initialization via a list. In previous versions of C++, it was inconsistent how you would initialize lists which would lead to a small amount of … Continue reading
The Placement New Operator
I’d like to shed a little bit of light on a dusty corner of the C++ language: there’s more than one “new” operator! Well, since you’ve likely encountered the vector new (new[]) operator, I should say there’s more than two … Continue reading
The comma
As C and C++ programmers, we’ve probably seen and used the comma countless times in our applications, without thinking too much about it. However, there are some very interesting points to this piece of punctuation that are worth discussing. The … Continue reading
The Joys of Bit Fields
In C and C++, bit fields are one of the more odd declaration types that you run into rarely. The basic idea behind them is to provide the programmer with a way to define declarations at the bit-level. For instance, … Continue reading