N4283: Atomic View, revision 2 -- Carter Edwards and Hans Boehm

New WG21 papers are available. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N4283

Date: 2015-01-26

Atomic View, revision 2

by Carter Edwards and Hans Boehm

Excerpt:

This paper proposes an extension to the atomic operations library [atomics] for atomic operations applied to non-atomic objects. The proposal is in three parts: (1) the concept of an atomic view, (2) application of this concept for atomic operations applied to members of a very large array in a high performance computing (HPC) code, and (3) application of this concept for atomic operations applied to an object in a large legacy code which cannot replace this object with a corresponding atomic<T> object.

CppCon 2014 Data-Oriented Design and C++--Mike Acton

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:

Data-Oriented Design and C++

by Mike Acton

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

The transformation of data is the only purpose of any program. Common approaches in C++ which are antithetical to this goal will be presented in the context of a performance-critical domain (console game development). Additionally, limitations inherent in any C++ compiler and how that affects the practical use of the language when transforming that data will be demonstrated.

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 Implementing Wire Protocols with Boost Fusion--Thomas Rodgers

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:

Implementing Wire Protocols with Boost Fusion

Summary of the talk:

There are a number of common serialization formats available which work well for marshaling C++ types into messaging protocols, e.g. ProtoBufs, Thrift, JSON, XML, FIX, etc. Unfortunately, not every protocol uses one of these popular encodings and instead implements a unique binary protocol. The classical "C" way of handling binary protocols is to use packed structs, unfortunately there are many binary protocols which are not particularly friendly to using this approach due to things like nested variable length data structures, etc.. The packed struct approach is also fairly limited in that it only generally supports primitive POD types.

This talk will explore an approach that uses Boost's Fusion library to implement an easily extensible serialization mechanism for on a non-trivial binary financial exchange protocol which exposes the underlying data in terms of "modern" C++ types. The talk will also cover aspects of general use of Boost Fusion and Boost MPL, type traits, enable_if, SFINAE, and other members of the C++ type system bestiary.

for_each_arg -- Eric Niebler

Eric Niebler picked up the Sean Parent's challenge regarding his for_each_argument tweet.

for_each_arg

by Eric Niebler

And after several iterations between Sean and Eric this is the beautiful result:

template<class F, class...Ts>
F for_each_arg(F f, Ts&&...a) {
  return (void)initializer_list<int>{(ref(f)((Ts&&)a),0)...}, f;
}

 

C++11 and 64-bit Issues--Andrey Karpov

Developing 64-bit applications in C/C++ requires much attention from a programmer. There are a number of reasons for 32-bit code to fail to work properly when recompiled for the 64-bit platform. Let's find out if the new features introduced in C++11 have made 64-bit software programmers' life any better and easier.

C++11 and 64-bit Issues

by Andrey Karpov

From the article:

Extensive use of the C++11 language's new constructs in your code doesn't guarantee that you will avoid 64-bit errors. However, the language does offer a number of useful features to help make your code shorter and safer.

A Small Set-Algorithm For Enum Values -- Felix Petriconi

Inspired by Sean Parent's recent Tweet I came up with this idea:

A Small Set-Algorithm For Enum Values

by Felix Petriconi

From the article:

Often we have in our own production code statements like this:

auto predicate = [](State state) {
  return state == MyEnumClass::ValueA ||
         state == MyEnumClass::ValueD ||
         state == MyEnumClass::ValueEWithAVeryLongName;
};

A better readable solution with less typing is described there.