Articles & Books

User-Defined Literals, Part 1 -- Andrzej KrzemieĊ„ski

New article by Andrzej Krzemieński:

User-defined literals — Part I

This post is about the new language feature: the ability to specify user-defined literals. You may already be familiar with it, for example from N2750. In this post we will talk about literals in general, the purpose and usefulness of user-defined literals, their limitations, and alternatives in C++ to achieve similar goals.

[more]

Destructors That Throw: Evil, or Just Misunderstood? -- Jon Kalb and Dave Abrahams

Interesting new C++Next article about destructors that throw:

Evil, or Just Misunderstood?

by Jon Kalb and Dave Abrahams

From the script-style intro:

UDT (putting down drink and looking deep into CODER’s eyes): By the way, in my destructor I throw if the file fails to close properly.

CODER: I can live with that. [...] I’ve always been a sucker for dangerous types.

FADE TO BLACK

NARRATOR (V.O.): We invite you to journey with us now, into the heart of darkness, where we seek out throwing destructors and stare Evil™ in the face. Will CODER survive his encounter with exceptional destruction? The answers lie beyond the frontiers of usual best practice…

Continue reading...

C++ Primer 5th Edition, Part 1: How To Revise a Textbook

The C++11 update to the classic C++ Primer is almost here! Andy Koenig reports:

Barbara Moo shipped the completed text of the C++ Primer, Fifth Edition to the publisher on July 13. As far as I know, copies are already being printed; they should be on bookstore shelves by mid-August.

This book has been a major project for her for the past two years or so, and an all-consuming one since about the beginning of this year. I've spent a fair amount of time on it as well: reading drafts, making comments and suggestions, running test programs, and so on. As a result, I've had a pretty good idea of what she's been thinking about as she wrote the book, and I'm in a position not only to tell you what I've learned about her strategy, but also why I think her strategy is a sensible one

[more]