Articles & Books

Papers for Chicago: Concurrency

The start of my series about the papers for the upcoming Chicago meeting, starting with C for Concurrency:

C++ Papers for Chicago: Part 1 -- Concurrency

by Jens Weller

From the article:

As I did write a series about the papers for Bristol, this is the start of the series for Chicago, as at the end of this month the C++ committee will meet again for standardization. I try to...

Value-initialization with C++ -- Andrzej KrzemieĊ„ski

Do you know what value-initialization means, and why it's simpler in C++11?

Value-initialization with C++

by Andrzej Krzemieński

From the article:

Some time ago, I showed how boost::value_initialized can be used to value-initialize objects in generic components in C++03. In C++11 it is practically not necessary. C++11 gives you a way to force value-initialization of your objects in any possible initialization context.

Are you familiar with term “value initialization”? It is sometimes confused with “default-initialization”...

Planetary: First Smithsonian curation of code created using C++ and Cinder-- S Chan & A Cope

The first piece of code acquired by the Smithsonian's Cooper-Hewitt National Design Museum -- "Planetary", written in C++.

Planetary: collecting and preserving code as a living object

Posted by Sebastian Chan & Aaron Cope on Monday August 26, 2013

From the article:

Cooper-Hewitt has just acquired its first piece of code. Although the collection has objects that are the end result of algorithmic processes, notably Patrick Jouin's 3D printed chair, Solid C2, this is the first time that code, itself, has been collected.

Almost all contemporary design practice involves digital processes -- from the ubiquitous Adobe design software to CAD packages used by product designers and architects, to the simple day-to-day office management and accounting software -- it would be difficult to find a designer who lives entirely 'off the grid.’ Despite this, design museums have been slow to start to add software to their permanent collections.

Some of this reticence to collect digital objects stems from deep uncertainties as to how to preserve and present such objects to future visitors and future scholars. But for Cooper-Hewitt these uncertainties have been a strong driver to experiment.

So, here we have Planetary.

Planetary is an iPad application written in C++ using the Cinder framework. Planetary offers an alternative music player application for the iPad that visualizes your music collection as a series of celestial bodies. Songs are moons, albums are planets, artists are suns—and the orbits of each are determined by the length of albums and tracks. Their brightness represents their frequency of playback.

Continue reading...

Tales of C++ - Episode Six: Boollocks--K-ballo

Tales of C++, Episode 6:

Boollocks

by K-Ballo

From the article:

In the beginning there was no bool. And C++ said "let there be bool", and there was bool...

The Boolean data type is an integral type with only two values: true and false, intended to represent the truth values of logic and Boolean algebra. With only two values, what can possibly go wrong?

Continue reading...

C++ Conferences This Fall

I've created a short overview over the C++ Conferences this Fall:

  • Going Native (Seattle, 4.th-6.9) SOLD OUT
  • International Workshop on OpenMP (Canberra (AU), 16-18.9)
  • (not a conference, but...) Fall ISO C++ meeting (Chicago, 23-28.9)
  • QtDevDays Europe (Berlin, 7th - 9.10)
  • QtDevDays US (San Francisco, 6th-8.11)
  • Meeting C++ 2013 (Düsseldorf, 8th-9.11)
  • C++ and Beyond (Snoqualmie Falls (WA/US), 9th-12.12) SOLD OUT

More details at Meeting C++

by Jens Weller

Revisiting the BlackBerry 10 NDK

I've been looking at the BlackBerry 10 NDK the last weeks, and did write about it to share some thoughts and results.

Revisiting the BlackBerry 10 NDK

by Jens Weller

From the article:

The last few weeks I did look again at the BlackBerry 10 NDK, as a client had asked for help and training. I offered to adapt my Qt Introduction course to the BlackBerry plattform, and offered my advice...

Before I start, a short paragraph about Apps and C++. People coming from Java or .NET often don't understand the need to make Apps in C++...

Quick Q: How is std::function implemented? -- StackOverflow

Quick A: Using type erasure.

Quick Q2: ... Um, what's that?

Quick A2: Read this post...

How is std::function implemented?

According to the sources I have found, a lambda expression is essentially implemented by the compiler creating a class with overloaded function call operator and the referenced variables as members. This suggests that the size of lambda expressions varies, and given enough references variables that size can be arbitrarily large.

An std::function should have a fixed size, but it must be able to wrap any kind of callables, including any lambdas of the same kind. How is it implemented? If std::function internally uses a pointer to its target, then what happens, when the std::function instance is copied or moved? Are there any heap allocations involved?

A Glimpse into C++14: Combine Flexibility and Performance with Dynamic Arrays and... -- Danny Kalev

cpp14-target.jpgDanny Kalev wrote a nice article yesterday about a new C++ feature -- actually, two related C++14 features -- that were just added to the draft Standard in April and will be coming to real compilers in the near future.

A Glimpse into C++14: Combine Flexibility and Performance with Dynamic Arrays and Runtime-Sized Arrays

by Danny Kalev

From the article:

C99 introduced the notion of variable length arrays: stack allocated built-in arrays whose size is determined at runtime. C++ lacks a similar feature, to the discontent of many a programmer. However, two recent proposals for adding dynamic arrays and runtime-sized arrays to C++14 are closing the gap at last. Learn how to use these new features to imitate C99’s variable length arrays in C++...

Optimizing C++ Code: Dead Code Elimination -- Jim Hogg

We keep hearing about C++'s "as if" rule, but what does it really do? Fundamentally, it enables optimizations. A modern compiler never produces an executable that's identical to the program you actually wrote; it produces an equivalent program that's probably a lot better.

Hence Jim Hogg's nice new series on what optimizing compilers do, using Visual C++ as an example. The latest instalment:

Optimizing C++ Code : Dead Code Elimination

by Jim Hogg

From the article:

This post examines the optimization called Dead-Code-Elimination, which I’ll abbreviate to DCE.  It does what it says: discards any calculations whose results are not actually used by the program.

Now, you will probably assert that your code calculates only results that are used, and never any results that are not used: only an idiot, after all, would gratuitously add useless code -- calculating the first 1000 digits of pi, for example, whilst also doing something useful.  So when would the DCE optimization ever have an effect? ...