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
Monthly Archives: September 2011
Virtual Methods
Virtual functions are a fairly well-understood programming construct in terms of how and when to use them. But have you ever stopped to think about how they actually work under the hood? You’ve probably heard the term “vtable” thrown around … Continue reading
Static asserts
One of the new features of C++11 is the ability to do a compile-time assertions. These assert functions are similar in concept to the runtime assert functions we all know and love. You pass in a constant expression and a … Continue reading
Threading on Windows
Threads are becoming one of the more ubiquitous concepts in programming. Chances are quite good that you’ve a few of them before. But have you ever stopped to think about how a thread works under the hood? There are some … Continue reading
Understanding Undefined Behavior
One of the harder concepts for people to understand in C++, in my opinion, is “behavior.” In C++, the language has some very specific wording for what the various behaviors are, and I’ve seen a lot of people get them … Continue reading
Be Carefully Consistent With Memory
One of the things that most C/C++ programmers start to take for granted is memory. It’s always there, and when used properly, it always “just works.” However, frameworks throw a bit of a monkey wrench into the equation because they … Continue reading
Preventing Evil Operator Overloading
While doing some research on allocators, I noticed that the language specification has some interesting wording with regards to getting the address of an element from an allocator. Specifically, it says (Section 20.6.9.1 Clauses 2 & 3): Returns: The actual … Continue reading
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.