Tag Archives: C++0x

Member Function Ref Qualifiers

One of the lesser-known features of C++11 is the fact that you can overload your non-static member functions based on whether the implicit this object parameter is an lvalue reference or an rvalue reference by specifying a functions ref-qualifier. This … Continue reading

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

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

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

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

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

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

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

Discriminated Unions

In computer science, a discriminated union is one of the many names given to the concept of a “catch-all” datatype. (You’ll also hear it referred to as a variant.) It’s meant to hold data of any type at any given … Continue reading

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

Inline Namespaces

One of the neat, new language features of C++0x that is targeted firmly at framework designers is the ability to declare “inline” namespaces. While the name may seem a bit strange at first, the concept is quite intuitive. It allows … Continue reading

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

Move Semantics

One of the new features in C++0x is a way to express move semantics. This is a sensible piece of sibling functionality to copy semantics, which you’ve likely already run into. When writing copy semantics for a class, the idea … Continue reading

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