Using Enum Classes as Bitfields—Anthony Williams

How to use enum classes as as bitfields in modern C++ programs.

Using Enum Classes as Bitfields

by Anthony Williams

From the article:

C++11 introduced a new feature in the form of scoped enumerations, also referred to as enum classes, since they are introduced with the double keyword enum class (though enum struct is also permissible, to identical effect). To a large extent, these are like standard enumerated types: you can declare a list of enumerators, which you may assign explicit values to, or which you may let the compiler assign values to. You can then assign these values to variables of that type. However, they have additional properties which make them ideal for use as bitfields. I recently answered a question on the accu-general mailing list about such a use, so I thought it might be worth writing a blog post about it.


Interactive Metaprogramming Shell based on Clang

A new video from Meeting C++ 2014:

Interactive Metaprogramming Shell based on Clang

by Ábel Sinkovics

From the talk description:

Developing metaprograms is hard and painful. Templight ( supports the development and debugging of template metaprograms, but the code has to be recompiled after every minor change and tricks are needed to retrieve useful information about the result...

The compiler can make up its own calling conventions, within limits—Raymond Chen

A new article from the Old New Thing:

The compiler can make up its own calling conventions, within limits

by Raymond Chen

From the article:

There are three parties to a calling convention. The function doing the calling. The function being called. The operating system. The operating system needs to get involved if something unusual occurs, like an exception, and it needs to go walking up the stack looking for a handler...

Expression Templates Revisited

A new video from Meeting C++ 2014!

Expression Templates Revisited

by Klaus Iglberger

From the talk description:

Since their invention in 1995, Expression Templates (ETs) have proven to be a valuable tool for many C++ template libraries. Especially numerics libraries quickly embraced them as salvation for the performance deficiencies of standard C++. This reputation as performance optimization...

C++ SIMD parallelism with Intel Cilk Plus and OpenMP 4.0

A new video from Meeting C++ 2014

C++ SIMD parallelism with Intel Cilk Plus and OpenMP 4.0

by Georg Zitzlsberger

From the talk description:

Performance is one of the most important aspects that comes to mind if deciding for a programming language. Utilizing performance of modern processors is not as straight forward as it has been decades ago. Modern processors only rarely improve serial execution of applications by increasing their frequency or adding more execution units.

CppCon 2014 The Canonical Class—Michael Caisse

While we wait for CppCon 2015 in September, we’re featuring videos of some of the 100+ talks from CppCon 2014. Here is today’s feature:

The Canonical Class

by Michael Caisse

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

It was a simpler time. A period in which every college student and learn-C++-in-a-weekend duffer could write a class with the assuredness that it would behave as desired when assigned and copied. There was a check list. Complete the checklist, add some domain specific behaviour, bake in the regression oven, and you were done.

Enter C++11 with its fancy new use of the delete keyword, additional applications of explicit, rvalue references, and some perfect forwarding. How are you to write a "simple" class? Should you include a swap? What does movable mean and are there expected semantics? When is the noexcept specifier used?

During this session we will explore the boilerplate of a C++11 class. The session will touch on rvalue references, move semantics, perfect forwarding, explicit, noexcept, initializer lists, and more as it applies to producing the desired semantics for our classes and structs.

Generic Parallel Programming

A new video from Meeting C++ 2014:

Generic parallel programming for scientific and technical applications

by Guntram Berti

From the talk description:

Technical and scientific applications dealing with a high computational load today face the challenge to match the increasingly parallel nature of current and future hardware. The talk shows how the increased complexity of software can be controlled by using generic programming technologies. The process and its advantages are introduced using many concrete examples...

Providing Explicit Specializations for Non-Template Members of Class Template—Pavel Frolov

One of the lesser-known features of C++ templates.

Providing Explicit Specializations for Non-Template Members of Class Template

by Pavel Frolov

From the article:

C++ is full of surprises (albeit not always good ones grin. It is a well known fact that you can provide explicit specializations for function templates and class templates. But it was a total surprise to me, that you can provide explicit specializations for non-template members of class template without specializing the class template itself!

The C++ Memory Model - Valentin Ziegler @ Meeting C++ 2014

A new video from Meeting C++ 2014:

The C++ Memory Model

by Valentin Ziegler

From the talk description:

The C++ memory model defines how multiple threads interact with memory and shared data, enabling developers to reason about concurrent code in a platform independent way. The talk will explain multi-threaded executions and data races in C++...