Home > Articles > Programming > C/C++

C++ Reference Guide

Hosted by

Toggle Open Guide Table of ContentsGuide Contents

Close Table of ContentsGuide Contents

Close Table of Contents

The Removal of Concepts From C++0x

Last updated Jan 1, 2003.

On Monday, July 13th 2009 Concepts were dramatically voted out of C++0x during the C++ standards committee meeting in Frankfurt. This shocking news raises many questions and concerns. Unquestionably, these will be discussed in various forums in coming weeks and months. However, I will try to answer three burning questions here: What led to the failure of Concepts? How will the removal of Concepts affect C++0x? Will Concepts make a comeback in the near future?

The Writing on the Wall

When I first heard the news, I couldn't believe it. Concepts were supposed to be the most important addition to core C++ since 1998. Tremendous efforts and discussions were dedicated to Concepts in every committee meeting during the past five years. After dozens of official papers, tutorials and articles -- all of which were dedicated to presenting and evangelizing Concepts -- it seemed very unlikely that just before the finishing line, Concepts would be dropped in a dramatic voting. What caused this change of heart among committee members?

Early warning signs emerged long ago. Initially, Concepts were supposed to be integrated into the Standard Library. The C++0x Committee Draft (approved in September 2008) uses concepts in the Standard Library extensively but committee members expressed their concern that concepts were "untried, risky and controversial". The problem was this: other than ConceptsGCC, there weren't any C++ implementations that supported concepts and therefore, it was impossible to field-test them in real world projects or get feedback from individual users other there.

Two strong undercurrents shook and undermined the entire Concepts foundation. First, skepticism regarding the feasibility and usefulness of concepts intensified the antipathy towards this proposal. Some people expressed concerns about compile-time and runtime overhead. Second, the creators of the Concepts proposal tried desperately to improve and patch Concepts. The last nail in the coffin was Bjarne Stroustrup's paper "Simplifying the Use of Concepts" from June. It's a masterpiece in terms of presenting Concepts but it also scared folks. The general sense was that concepts were broken, the committee was not sure what the correct direction was to fix them, and it would probably take several more years to come up with a reasonable fix that would achieve consensus.  Considering that Concepts were originally designed to simplify C++, a critical mass of committee members agreed in July 2009 that it was time to bid Concepts goodbye.

Possible Directions

It's still unclear at the time of writing which alternatives the committee will choose. A total overhaul of Concepts is one possibility, however unlikely. This could take up to five years and no one is certain that the redesigned Concepts will not have introduced other problems. A second approach is to leave the door open for a drastically reduced and diluted Concepts proposal. The third approach is to refine the current Concepts proposal further, knowing that it will not be integrated into C++0x. I'm willing to bet on the following -- Concepts are dead for good. Certain members are certain that C++ will have concepts in five years from now, but the C++0x standard will not wait until then, and once the standard has been ratified by ISO, any features waiting in the pipeline will have to wait for the next standard. Five more years means forever, I regret to say. I remember similar promises about a built-in garbage collector back in 1997. And besides, why pursue the current notion of concepts which has thus far proved to be futile? Maybe it's best to start from scratch?

The Concepts proposal was doomed among other reasons because the committee wasn't standardizing existing practice (which is what it usually does) but instead, invented a huge, complex and controversial feature ex nihilo. History shows that features that were added in this unusual way to C++ have all failed. This was the case with exception specifications and exported templates.

Implications and Analysis

It's hard to tell at this stage how the removal of Concepts will affect C++0x. Clearly, the impact will be huge because many other C++0x features presuppose Concepts. In the coming weeks, the committee will have to scrutinize all outstanding proposals and the Committee Draft to assess the impact of this decision.

How will C++0x programming and design look like without Concepts? Brace yourself for many more years of indecipherable template compilation errors. Additionally, type traits will become a hot commodity once again. Presently, type traits are one of the very few proven techniques for enforcing compile-time constraints on templates. Pedagogically, C++ will be a tad easier to teach.

The removal of Concepts paves the way to other radical changes. If Concepts could be removed, there's no reason why other "safe" features should become sacred cows. No, I'm not going to name such features but suffice it to say: the Committee Draft has plenty of features that need to be reconsidered or dropped.

The collapse of Concepts might seem as a sad end to a well-intended attempt to solve a fundamental problem. However, there's no reason for sobbing. This story shows that the committee isn't afraid to take tough decisions if it has to. It's also a good reminder to all programming languages' designers: don't get enamored of your own proposals. Every new proposal seems neat and promising at first but after a few iterations and redesigns, it might easily turn into a bloated tumor that impedes the natural growth and evolution of the language (namespaces anyone?). If we're ever going to have concepts in C++, it's "the marketplace", not the committee, that needs to do its work first and only then should the committee bless the result -- if it so chooses. Doing things the other way around is a recipe for failure.