New paper: N3528, Minutes of Feb 5 2013 SG1 (concurrency) teleconference

As an experiment to make C++ standardization papers more accessible, we're trying out a new idea: posting links to papers as the papers become available. This does not replace the committee mailings; the papers will still be collected and made available in the regular mailings (about four times a year) and those mailings will also still be announced here. The purpose of this experiment is to try to publish papers earlier and more often, so as to make it easier to get feedback sooner from a wider audience and reduce the glut of papers that need to be absorbed before meetings. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Note that some papers, like this one, will be mainly informational rather than proposal papers for technical discussion. 

Here's the first:

Document Number: N3528

Date: 2013-02-05

 

Minutes of Feb 5 2013 SG1 Phone Call

by Pablo Halpern

 

Stroustrup’s Tour of C++: Fourth chapter posted

The final installment of Bjarne Stroustrup's four-part Tour of C++ is now available. This material is a preview draft of Chapter 5 of Stroustrup’s upcoming The C++ Programming Language, 4th Edition.

A Tour of C++, Part 4: Concurrency and Utilities

by Bjarne Stroustrup

Bjarne writes:

Describe all of C++ in 100 pages (or less). Don't just describe the language, include the standard library. Don't use "white lies" to simplify. Describe the major programming styles and techniques. Give rationale. Don't forget about concurrency. And, oh, by the way, make it readable to programmers (do not require a PhD).

That was the task I set myself when I decided to write the "Tour of C++" for TC++PL4. I suspect that succeeding perfectly is beyond me, but at least I met the first criteria: The tour is currently 98 pages, and shrinking.

This last, part 4, of the tour presents concurrency and some of the newer standard-library facilities.

Enjoy!

See the whole Tour here.

Closer to Perfection: Get to Know C++11 Scoped and Based Enum Types -- Danny Kalev

Here's a nice intro and overview of one of the smaller features that makes C++11 safer.

Speaking of scoped and based enums, here's an interesting historical tidbit you may not know: These were initially co-proposed for C++ by an expert working on mission- and life-critical software and a large horizontal software company. Just goes to show the broad applicability of features like these, that matter where safety is critical and also help everyone.

Closer to Perfection: Get to Know C++11 Scoped and Based Enum Types

by Danny Kalev

C++ enum types pack a set of related constants in an intuitive and efficient user-defined type. Can you ask for more? With two new C++11 enhancements, namely scoped enums and based enums, the answer is "yes." Find out all about the recent facelift that C++11 enums underwent and learn how to refactor your code to benefit from the new enum features – without sacrificing performance or backward compatibility.

From the intro:

Enums are one of my favorite C++ features. They exemplify the notion of an efficient user-defined type without the heavy machinery of virtual functions, constructors, etc. (Compare C++ enums to other programming languages that still insist on using a full-blown class instead, and you’ll see what I mean.)

Yet, traditional enum types aren't flawless. ... C++11 addresses these issues with revamped enumerations that give you tighter control over the scope, size, and implicit conversions of enum types. Let's look at these new features more closely, and examine how they can improve both our code quality and frustration level.

Continue reading...

Core C++, 7 and 8 of N: Loops, ODR, and variadic array sorter

Two advanced talks by Stephan T. Lavavej (aka STL) are now available, the second being posted today:

Core C++, 7 of N

In Part 7, STL teaches us about Usual Arithmetic Conversions, Template Metaprogramming (TMP), and shares some of the Visual C++ STL internal implementation (some of it not yet released). Many of you have asked for some treatment of TMP and STL delivers!

Core C++, 8 of N

In part 8, STL digs into the do-while loop, casts, one definition rule (ODR), and his variadic template array sorter. There is a lot of information in this episode, so get comfortable, tune in, and learn.

Boost 1.53.0 Released

Release 1.53.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 five new libraries and numerous enhancements and bug fixes for existing libraries.

New Libraries:

  • Atomic: C++11-style atomic<>, from Helge Bahmann, maintained by Tim Blechmann.
  • Coroutine: Coroutine library, from Oliver Kowalke.
  • Lockfree: Lockfree data structures, from Tim Blechmann.
  • Multiprecision: Extended precision arithmetic types for floating point, integer and rational arithmetic from John Maddock and Christopher Kormanyos.
  • Odeint: Solving ordinary differential equations, from Karsten Ahnert and Mario Mulansky.

Links:

Thanks,

--The Boost release team

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

B-Tree Containers from Google

Google has graciously gifted to the community a set of STL-like containers that use B-trees under the covers. The code has been released under the Apache 2 license.

C++ Containers That Save Memory And Time

We’re pleased to announce C++ B-Tree, a C++ template library that implements B-tree containers with an analogous interface to the standard STL map, set, multimap, and multiset containers. B-trees are well-known data structures for organizing secondary storage, because they are optimized for reading and writing large blocks of data. But the same property that makes B-trees appropriate for use with databases and file systems also makes them appropriate for use in main-memory, just with smaller blocks. [...]

Continue reading...

Online C++ compilers


Many people don't realize how many web pages offer access to try out C++ compilers, including many of the latest compilers with burgeoning C++11 language support. So we thought we'd publish a list.

Do you:

  • want to try out C++, but don't have a compiler installed?
  • want to try out a C++11 feature your compilers don't yet support?
  • want to compare the results of compiling a test program using different compilers?

Then try one of these online compilers! Some are compile-only to let check whether your code is legal, and some let you also run your test programs to see their output. For each, we include a list of the compilers that the page currently supports -- they include the latest from Clang (3.2, Dec 2012), GCC (4.8.0 prerelease), Intel (13.0, Oct 2012), and Microsoft (VC++ alpha CTP, Nov 2012).

This list is now also available on the Get Started! page.

Quick Q: What can I do with a moved-from object? -- StackOverflow

Quick A: It's a valid object with an unspecified state, so start by using member functions that have no preconditions. For example, assign a new value to the object.

What can I do with a moved-from object?

Does the standard define precisely what I can do with an object once it has been moved from? I used to think that all you can do with a moved-from object is do destruct it, but that would not be sufficient...

Effective C++11 update -- Scott Meyers

This week, Scott Meyers posted a couple of updates on how C++11 is coming to one of the world's most-loved C++ book series -- Effective C++.

 

First, here's Scott's preamble about his approach to Effective C++11:

Effective C++11: Background

I've mentioned in some earlier posts that I plan to start writing a new book, Effective C++11.  The purpose of this post is to tell you a little bit about it. Lest there be confusion, let me emphasize that there is no book yet. If everything falls into place the way I hope it will, there will be a book about 10 months from now. If. I'm not making any promises. [...]

 

As a followup, Scott then posted an early draft list of candidate Items for Effective C++11 as part of this post:

Effective C++11: Content and Status

[...] At last year's C++ and Beyond, I gave a talk entitled "Initial Thoughts on Effective C++11." It had my usual guideline format. I also gave a talk on "Secrets of the C++11 Threading API," which consisted of observations about C++11's threading support. The material in those talks, combined with the feedback I got from giving them and mixed in with my experience explaining the idea of universal references, ultimately yielded the initial list of candiate Items for EC++11. The current snapshot of my vision for Effective C++11 is: [...]

At least a million developers are looking forward to your book, Scott!

No pressure.