"Panel: Static If, C++11, Modern Libraries, and Metaprogramming" -- Alexandrescu, Meyers, Sutter

The first panel from C++ and Beyond 2012 is now available on Channel 9:

On Static If, C++11 in 2012, Modern Libraries, and Metaprogramming

Andrei Alexandrescu, Scott Meyers, Herb Sutter

Channel 9 was invited to this year's C++ and Beyond to film some sessions (that will appear on C9 over the coming months!)...

At the end of day 2, Andrei, Herb and Scott graciously agreed to spend some time discussing various modern C++ topics and, even better, answering questions from the community. In fact, the questions from Niners (and a conversation on reddit/r/cpp) drove the conversation.

Here's what happened...

[more]

Boost 1.51.0 released

Release 1.51.0 of the Boost C++ Libraries is now available.

These open-source libraries work well with the C++ Standard Library, and are usable across a broad spectrum of applications. The Boost license encourages both commercial and non-commercial use.

This release contains 1 new library (Boost.Context, by Oliver Kowalke) and numerous enhancements and bug fixes for existing libraries.

Thanks,

--The Boost release team

    Beman Dawes
    Daniel James
    Eric Niebler
    Marshall Clow
    Rene Rivera
    Vladimir Prus

 

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]

Adobe flascc: C++ Compiler for Flash

Want to reach a billion people with your C++ program?

Flash Runtime C++ Compiler (flascc)

Bring your native C/C++ games from consoles and PCs to over a billion people on the web — across browsers, with no install. ... console-quality games with blazing fast performance across web browsers, including Chrome, Firefox, Internet Explorer, and Safari.

“Games built for high-end consoles can now run on the Web or as Facebook apps, reaching an enormous user base. This totally changes the playing field for game developers.” — Tim Sweeney, Founder, Epic Games

“The Flash Player version of Unreal Tournament 3 turned out to look even better than the version we shipped on Xbox 360 and PlayStation 3.” — Mark Rein, Vice President, Epic Games

Where To Get the Standard (and Drafts)

I'm not calling out all the changes we're making as we gradually add information to the site, but here's a new page many people will find useful...

The Standard: "Want to read the standard, or working drafts of the standard? You have several options, most of them free." This page summarizes:

  • where to get the current standard (official for $30, or almost-official for free);
  • where to get working drafts (prebuilt or at GitHub); and
  • what to expect, that the standard is a treaty, not a tutorial.

Enjoy!

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++11 Style: A Touch of Class -- Bjarne Stroustrup

Bjarne Stroustrup will be appearing live next month to deliver his popular talk on what "Modern C++" should mean in the 2010s.

C++11 Style: A Touch of Class
Bjarne Stroustrup

Date: September 19, 2012
Time: 6:30pm
Location: Austin, TX, USA 

We know how to write bad code: Litter our programs with casts, macros, pointers, naked new and deletes, and complicated control structures. Alternatively (or in addition), obscure every design decision in a mess of deeply nested abstractions using the latest object-oriented programming and generic programming tricks. For good measure, complicate our algorithms with interesting special cases. Such code is incomprehensible, unmaintainable, usually inefficient, and not uncommon.

But how do we write good code? What principles, techniques, and idioms can we exploit to make it easier to produce quality code? I will make an argument for type-rich interfaces, compact data structures, integrated resource management and error handling, and highly-structured algorithmic code. I will illustrate my ideas and motivate my guidelines with a few idiomatic code examples.

I will use C++11 freely. Examples include auto, general constant expressions, uniform initialization, type aliases, type safe threading, and user-defined literals. C++ features are only just starting to appear in production compilers, so some of my suggestions have the nature of conjecture. However, developing a “modern style” is essential if we don’t want to maintain newly-written 1970s and 1980s style code in 2020.

This presentation reflects my thoughts on what “Modern C++” should mean in the 2010s: a language for programming based on light-weight abstraction with a direct and efficient mapping to hardware, suitable for infrastructure code.

Core C++, 3 of N: Overload Resolution -- Stephan T. Lavavej

Core C++, 3 of N: Overload Resolution -- Stephan T. Lavavej

Stephan T. Lavavej, aka STL, will take us on a journey of discovery within the exciting world of Core C++. We know lots of folks are either coming back to C++, coming to C++, or have never left C++. This lecture series, in n parts, is for all of you! Only STL can make that work (novice, intermediate, and advanced all bundled together and presented in a way only STL can do).

In Part 3, STL digs into Overload Resolution. A function template can overload non-template functions of the same name. In this scenario, function calls are resolved by first using template argument deduction to instantiate the function template with a unique specialization (STL taught us all about TAD in Part 2). If template argument deduction fails, the other function overloads are considered to resolve the call. These other overloads, also known as the candidate set, include nontemplate functions and other instantiated function templates. If template argument deduction succeeds, then the generated function is compared with the other functions to determine the best match, following the rules for overload resolution. [source]

As STL says: "I walk through why foo(const T&) beats foo(const T *), when given int *. The reason is surprisingly subtle."

Tune in.

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]

 

 

 

Core C++, 2 of N: Template Argument Deduction -- Stephan T. Lavavej

Core C++, 2 of N: Template Argument Deduction -- Stephan T. Lavavej

Stephan T. Lavavej, aka STL, will take us on a journey of discovery within the exciting world of Core C++. We know lots of folks are either coming back to C++, coming to C++, or have never left C++. This lecture series, in n parts, is for all of you! Only STL can make that work (novice, intermediate, and advanced all bundled together and presented in a way only STL can do).

In part 2, STL will teach us all about Template Argument Deduction. Template arguments are deduced when a call is made to a template function, but some or all template arguments are omitted. The compiler will attempt to deduce the intended template arguments. In most cases, this works as expected. If it does not, a compilation error occurs, in which case you should specify the template arguments explicitly. Now, let's see what Stephan has to say about this.

Tune in. Learn.