Tag Archives: declarations

Value Types in C++11

You may have heard these terms used for various programming languages before, but I wanted to discuss them in a bit more detail since they’re a fairly fundamental concept in compilers that spill over into the way you use the … Continue reading

Posted in C/C++ | Tagged , , , | 6 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

Virtual Inheritance

A question came up on LinkedIn in the C++ group relating to how virtual class inheritance actually works. Since LinkedIn limits the amount of space for responses, and also manages to screw up code formatting, I decided to tackle the … Continue reading

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

How DLL Imports Work

When you make a function call into a function that exists in a DLL, what happens, exactly? How does the function call happen, and what work goes on behind the scenes to make it so? I want to cover some … Continue reading

Posted in Win32 | Tagged , , , | Leave a comment

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

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

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

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

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

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

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

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

Returning Stack-Based Values

The code looks innocuous enough, but something as simple as this can be the source of hard to track down bugs. I want to talk a bit about the dangers of returning stack-based values.

Posted in Framework Design | Tagged , | 4 Comments

Deleted Class Methods

One of the new features in C++0x is a declaration syntax allowing you to remove methods from a class entirely. While this may sound rather strange at first blush, it does have some interesting usages that will make your code … Continue reading

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