Welcome

We started this site because the community at large seems especially hungry—right now—to know more about, and to be more involved in, what’s happening on the cutting edge of C++. We’re going to be writing articles on C++0x and advanced C++03.

We hope you’ll treat these articles as conversation starters. Ask questions, disagree, rant and/or rave as you see fit. We want your feedback!

A Breakthrough for Concepts

This entry is part of a series, Having It All»

In the last article in this series, I mentioned that we’ve solved the problem with polymorphic lambdas and concepts, and I promised to discuss it here. So here we go!

Quick concepts review

Just like type declarations, concepts would add two kinds of type-checking to the C++ template system. To understand how, let’s first look at an ordinary C++ function: Continue Reading

Having it all: Pythy syntax for C++

This entry is part of a series, Having It All»

As I’ve been dreaming about the future of C++, I’ve started to ask myself, “what if we could have it all?” What if we could write C++ code with the agility of Python programmers, and still have all the static checking we really want, when we want it?

I’ll be honest with you; I haven’t been all that excited about the future of C++ recently, in large part because of the ever-growing weight of syntax that we use to describe our interfaces. Today it’s rvalue references and noexcept. Tomorrow it’ll be concept constraints and who-knows-what-else? It’s a drag. Continue Reading

Entries in this series:
  1. Having it all: Pythy syntax for C++
  2. A Breakthrough for Concepts
Powered by Hackadelic Sliding Notes 1.6.5

BoostCon 2011: Early Registration Deadline Approaching

The premier annual US C++ event, BoostCon, runs May 15-20, 2011 in beautiful Aspen, Colorado!

Hans Boehm, the father of C++ garbage collection and the C++0x threading model, headlines the fifth annual Boost Conference, with his keynote, “Threads and Shared Variables in C++0x.” Other sessions about which which I’m personally excited: Continue Reading

Appearing and Disappearing consts in C++

C++Next is happy to republish the following article by Scott Meyers, with Scott’s permission, of course. Thanks, Scott!

If you write “int i;” in C++, i’s type seems obvious: int. If you write “const int i;”, i’s type seems equally obviously to be const int. Often, these types are exactly what they seem to be, but sometimes they’re not. Under certain circumstances, C++ treats non-const types as const, and under others it treats const types as non-const. Understanding when consts appear and disappear lends insight into the behavior of C++, and that makes it possible to use the language more effectively.This article examines various aspects of type declaration and deduction in both current standard C++ as well as the forthcoming revised standard (C++0x), with an eye towards helping you understand how and why the effective type of a variable can be different from what’s “obvious.” You’ll find the article most useful if you are familiar with the basic rules for template argument deduction, are aware of the difference between lvalues and rvalues, and have had some exposure to the new C++0x features lvalue and rvalue references, auto variables, and lambda expressions. Continue Reading

Recommended Reading

There’s some very nice empirical work on evaluating the costs and benefits of using C++ exception-handling in this post.

Leave the first comment

W00t W00t Nix Nix!

Recently, Michal Mocny published an article applauding the C++ Committee’s recent decision to keep implicitly-generated move operations in the C++0x standard. I disagree, and I think it raises some really interesting questions about the standardization process and what’s next for C++, which I’ll discuss at the end. Continue Reading

Expressive C++: Expression Optimization

This entry is part of a series, Expressive C++»

Welcome back to Expressive C++, a series of articles about Embedded Domain-Specific Languages and Boost.Proto, a library for implementing them in C++. In previous articles, we discussed EDSLs as a way to provide expressive and powerful library interfaces. Well and good, but some might dismiss the whole “domain-specific language” thing as overly-cute operator overloading wankery. So this time around I’m going to talk about something near and dear to every C++ programmers’ hearts: performance. I’ll show you how to use Proto to perform optimizations your compiler can’t do, rewriting inefficient expressions and improving runtime performance. Continue Reading

Give a Talk at BoostCon 2011

Happy new year, everybody! First, I want to thank you all for making 2010 such a great year for this site. The discussions and ideas have been excellent, and we’re looking forward to an even better 2011. But first, a quick plea to all our readers: this year’s BoostCon, scheduled for May 15-20 in beautiful Aspen, Colorado, needs presenters. For whatever reason, we’ve had fewer submissions than usual so far… but it’s not too late! Continue Reading

"Elements of Programming" Chapter 5: Ordered Algebraic Structures

This entry is part of a series, Elements of Programming»

This chapter provides a taxonomy for a number of concepts from abstract algebra, and then proceeds to implement functions that relies only on the minimum requirements to implement them (similar to how STL algorithms are defined in terms of the minimum requirements on types, and where stronger guarantees may result in more efficient algorithms, such as std::advance). Continue Reading

Expressive C++: Trouble With Tuples

This entry is part of a series, Expressive C++»

Welcome to the latest in a series of articles about Embedded Domain-Specific Languages and Boost.Proto, a library for implementing them in C++. Brace yourself; this article is going to range all over, from Haskell-style pattern matching to TR1‘s tuples, and draw from the function composition technique from the last article—all to enhance the 30-line lambda EDSL we’ve been developing—which, when the dust settles, will be far more than 30 lines. By the end, we will know how to compose non-trivial computations on expression trees from simple building blocks, claim more functional programming territory for our own, and even have a slightly more useful lambda library to show for our efforts. Continue Reading