Author Archives: Aaron Ballman

Tail Calls

A tail call is a specific pattern of source code where the last instruction executed in a method is another function call. For instance: In this code, the call to last is considered a tail call because there are no … Continue reading

Posted in C/C++ | Tagged , , | Leave a comment

Frustrations in Assembly

At my day job, we do a lot of complex math calculations in our frameworks. To increase performance, we have enabled the optimizer to use certain assembly instruction sets such as MMX and SSE. However, we have found that not … Continue reading

Posted in Uncategorized | Tagged , | 1 Comment

Lovely Holiday

I had a very nice holiday season this year, and I hope you did as well. My wife and I went down to TX to visit her family, and spend time lounging in a beach house. I didn’t write any … Continue reading

Posted in Uncategorized | 2 Comments

Whining about iterators

In the STL, there are multiple classes of iterators: random access, bidirectional, forward, input, and output. I’d like to discuss the different types of iterators in a bit more detail, so that I can whine about “missing” functionality.

Posted in C/C++ | Tagged , | Leave a comment

Stupid Compiler Tricks

A coworker approached me today with an interesting problem and I figured I’d talk about the crazy acrobatics that solved it. He wanted to fill out a list of operations to perform that could be registered easily “at compile time”, … Continue reading

Posted in C/C++ | Tagged , , | 7 Comments

String Resources

On Windows, when you need to access a string resource, you turn to the LoadString API. It takes care of finding the string for you, loading it, and copying it into the buffer you supply. However, there are times when … Continue reading

Posted in Win32 | Tagged , | 2 Comments

The Amazing Visitor Pattern

I’m a big proponent of using design patterns whenever they are the proper tool for the job. One of the design patterns I find myself pulling out of the toolbox fairly frequently these days is the visitor design pattern. However, … Continue reading

Posted in C/C++ | Tagged , | 1 Comment

A simple introduction to type traits

Type traits are a slightly more advanced topic in C++ because it they are heavily used in template metaprogramming. However, it is not an impenetrable concept, and it comes with some great benefits if you like to write generic, reusable … Continue reading

Posted in C/C++ | Tagged , , | 11 Comments

An Almost Useful Language Extension

While fiddling around a bit with clang, I came across an interesting C++ language extension from Microsoft. If you’ve done library development on Windows, you’ve likely come across the __declspec keyword for things like importing and exporting symbols from a … Continue reading

Posted in C/C++, Win32 | Tagged , , | 4 Comments

Destructors

Destructors are one of those inescapable concepts in C++. We’ve all used them, many times without even really thinking about it. But how do destructors work? What can and can’t you do with destructors? There’s a lot more complexity to … Continue reading

Posted in C/C++ | Tagged , | 7 Comments