ACCU 2018 Trip Report

 C++, Conference  Comments Off on ACCU 2018 Trip Report
Apr 172018

So, I am back home from my fourth ACCU 2018 conference in Bristol, UK. It has taken place from 2018-04-10 until 2018-04-14. This was my third conference as a speaker and the second as conference committee member. I will try to sort all the impressions from the recent five fantastic days.

Before I go into details on the individual sessions that I attended, I want to look back at the beginning of December 2017. Back when we, the conference committee, sat together, partly on location in London, partly we did attend via video conferencing to assemble a conference schedule. We had the difficulty to select from about 120 session proposals just about 60, where the majority was of high and very high quality. From my point of view, it was much more difficult than the year before – when it was the first year for me to attend the assembling meeting as a committee member. The quality of the abstracts was much higher this year. At the end of the day, we had a rough schedule of three C++ tracks and two with non-C++ content. I felt very sad, those good proposals of excellent speakers did not make it into the schedule.

Unfortunately, some accepted speakers have withdrawn their session so that we had to try to find replacements. In the end, unfortunately, we had even an empty 90 minutes slot. We had especially a high rate of withdrawn short 20 minutes sessions. But later more about this.

So the conference started as usual with a day of pre-conference tutorials. Since I did not attend any this year, I have to refer to other trip reports. Later in the evening the local Agile Bath & Bristol user group held their meeting in the conference’ venue and Seb Rose spoke about why User Stories should be made “RIVETing” and not “INVEST”.

The conference was opened on Wednesday with a short welcome by our conference chair, Russel Winder. Then Gen Ashley held the opening keynote with the title Diversity & Inclusivity in Tech. This keynote turned out not to be a traditional style of keynote but was structured as an introduction to the person and the organization and then a question and answer session. Whilst this seemed to work for some in the audience, it really wasn’t what I was expecting, seemed to miss an opportunity to address the issues, and thus it didn’t really
work for me.

After a short break I listened to Louis Dionne about Runtime Polymorphism: Back to the Basics. Even that he stated, that one should not listen to him,

Louis refers to Sean’s “Inheritence is the base class of all evil” talk

I kept doing it. Although the slides contained quite a lot of template code, he described very clearly in a well-structured form different approaches how to circumvent the disadvantages of runtime polymorphism through inheritance.

After lunch, I followed Roger Orr‘s Nothing is better than copy or move. It was easy to follow his explanations how passing of arguments to C++ functions and returning values from them have changed from the beginnings of C to recent C++17.

For the last session of the day, I chose a non-C++ topic and followed Charley Bay on his journey of A Quantum Data Structure For Classical Computers. He described very well the basics of quantization without going into much details of physics. At the end of his session, he took an outlook into quantum computing. Since I am interested in this topic, I will later take look at his slides, because they contained more information than I could catch during the session.

The day closed with a welcome reception.

Hadi Hariri opened the next day with his keynote Kotlin/Native – Embracing existing ecosystems. He gave the audience an overview of this newer programming language, that first was written for the JVM and that just got recently a native binding as well. Even that this language has some nice features and eases certain things compared e.g. to C++, it did not convince me to walk further in that direction.

Since I am personally very much interested in asynchronous programming and I am a co-author of the stlab concurrency library, I attended Detlef Vollmann‘s session Finally Executors for C++. He gave a good overview how the executor’s proposals have evolved and about the current state of the standardization process. But I could imagine that some attendees would have liked here a bit more introduction into the C++ standardization process and its terms.

During the lunch break, interested attendees could get an introduction to the charity organization Code Club. It is a worldwide organization and in the UK, they have already 6563 clubs and teach over 91,000 kids in programming. We could choose from different projects, should try to think like 8 to 13 years old kids and follow their first steps in programming. It was fun.

John Lakos made the point in his session C++ Modules and Large-Scale Development, that the upcoming C++ modules only help those who clean up their dependencies. Otherwise, they will gain nothing from the new language feature.

Procedural Programming: It’s Back? It Never Went Away by Kevlin Henney was my last session of the day. As all of his sessions before, that I have seen, it was brilliant! When its recording is set online, I recommend to view it.

During the second round of Lightning Talks, Robert Smallshire picked up the diversity topic from the first keynote and gave us a glimpse of an overview of a large international gender study. I would have expected to see this kind of information and more in the first keynote.

The day closed with the conference dinner. Besides an entertaining performance by a magician, I had very interesting discussions with the other attendees. Since we had this year again the rule, that the tables were mixed after each course, everybody came automatically into contact with different attendees.

Russel Winder – not Saruman or Sauron – is announcing changing of seats for the next course

The Friday’s opening keynote by Lisa Lippincott about The Shape of a Program followed more the format of a keynote, that I expected. She talked about her work to apply mathematical topology theory on procedural programs.

Kate Gregory spoke in her Simplicity: not just for beginners session afterward how important, but never the less much more difficult it is to write simple code. In her brilliant way, she established a connection to her keynote at the recent Meeting C++ conference so that those who have seen it, get a wider view on the overall story that she is telling, without losing those, who could not attend that conference or has seen it later online.

After lunch, I attended a slot of four short sessions. Gail Ollis spoke about What’s new about fake news? There she laid nicely out, that the phenomenon of fake-news is nothing new, but it is a problem that is already known for a longer time and that especially in a dictatorship it was and still is a widely used practice. Then I spoke about Can I change my organization?. Jim Hague spoke after me about The Clacks in Discworld and Roundworld, where he took a historic view on the origin of semaphores, a mechanical – optical system to transmit information over a great distance in France, invented by Claude Chappe. Jim compared it with the similar system that was later used in the UK.

As I have mentioned before, several speakers had withdrawn their short sessions, so we, the conference committee, decided that we ask the attendees in the whole plenary, if someone wants to step in and give a short talk. Fortunately, some were so kind and volunteered. One of them was Ahto Truu. He explained in a humorous way – the slides were photos of hand drawings on paper napkins, because of his spontaneous stepping forward for a short session – What are hash trees and why you should care. He did it in an excellent way and I hope that I might attend in the future a full 90 minutes session by him.

Even not so many attendees were present throughout this four sessions, we had some nice discussions in the short period of available time.

The last session of the day that I attended was by Daniel James where his topic was Cryptography for Programmers. Here he gave a good overview of the different standards and techniques to encrypt data. His presentation was very well structured. But at the end, it was sad that he could not show all of his slides, because of a lack of time. But whenever I have to follow up on this topic I will use his slides as a starting point.

Before an event sponsored by Bloomberg in a local brewery took place, we had a final set of Lightning Talks, presented by Pete Goodliffe. It was again a great fun. Pete, please come back next year!

The final day started for me with my own session on There Is A Better Future. I had only about 20-30 attendees, but many of them were very nicely participating in a lively discussion. Before the closing keynote, I went to Odin Holmes session about How to be polite to unicorns. In this expert session about template metaprogramming, he discussed ways to improve the compilation speed of TMP code. As an example, he used the heavily overloaded std::tuple constructor and std::tuple_cat. After a little harsh dive into a very complicated topic, his explanations become better and better and he had shown ways to improve the compilation times of such code.

The closing keynote Software development – learning to walk again by Seb Rose was a very nice and humorous presentation. With the help of an analogy of a hiking tour he did recently in the south of France, he went through the complete cycle of a software development project.

Overall I am really happy that I attended this conference. It was a pleasure to meet again so many nice people after one year and get to know new ones! I can recommend this conference as a place to deepen your knowledge in so many different areas and get an idea of new techniques out there.

And if you are interested in speaking at ACCU and you are afraid of giving a 90 minutes talk, then I recommend starting to present e.g. at your local user group or submit next year a short 20 min. presentation. From my personal point of view, doing a good Lightning Talk in 5 minutes is much more difficult than doing one in 20 minutes. So look out for Call For Papers next October.




Mar 262015

I just finished the first draft of the implementation of my enum_extend library. It is available via github.

It offers

  • Ranges over all defined enumerated values
  • Filtered ranges over a subset of enumerated values
  • ++ and — pre- and postfix operators
  • Attaching a textual representation to each enumerated value

Some examples:

using enum_extend::range;
using enum_extend::extender;
using enum_extend::filtered_range;

enum class Color
  Red = 0, 
  Green = 4, 
  Blue = 8

// Let's walk over all defined values
for (auto c : range<Color>()) {
  // ...

auto c = Color::Red;
// we can increment as well

// We iterate in reverse order over all defined values
std::vector<Color> allReverseColors;

// Just iterate over all values that match a certain criteria; 
// usefull if the enumerated values are defined as combined bit fields
auto FilterRed = [](Color c) { return c == Color::Red; };
for (auto c : filtered_range<Color>(FilterRed)) {
  // Do just something with red values

Only this specialization and the implementation of the operators is necessary:

template <>
  enum_extend::extender<Color>::all_values = { Color::Red, Color::Green, Color::Blue };

Color& operator++(Color& e) { 
  return enum_extend::extender<Color>::increment(e); 

Color& operator--(Color& e) { 
  return enum_extend::extender<Color>::decrement(e); 

Color operator++(Color& e, int) {                                            
  auto tmp = e;                                                            
  return tmp;                                                              

Color operator--(Color& e, int) {                                            
  auto tmp = e;                                                            
  return tmp;                                                              

There exists a set of macros that simplifies the process of specializing the extender and implementing the operators.

Much more details and examples can be found in this first tutorial

Feedback is welcome!


Jan 232015

Sean Parent posted today via Twitter this small neat algorithm:

template <class F, class... Args>
void for_each_argument(F f, Args&&... args) {
    [](...){}((f(std::forward<Args>(args)), 0)...);




During my today’s work I came across the problem that inside a predicate there was a check if a specific enum value is equal to a set of possible values.

So the code looked like this:

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

I don’t like this collection of comparisons for equalness. From my point of view it is some kind of semantically copy-and-paste.

So with Sean’s code in mind I started thinking and I searched for alternatives. The first used a std::initializer_list:

template <typename T>
bool is_in(const T& val, const std::initializer_list<T>& values) {
  return std::find(values.cbegin(), values.cend(), val) != values.cend();

So the example from above would read like this:

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

That is already better, but it does not read so fluently. So I tried to solve this with a builder like pattern:

template <class T>
struct Is {
  const T d_;
  bool in(const std::initializer_list<T>& values) {
    return std::find(values.cbegin(), values.cend(), d_) != values.cend();

template <class T>
Is<T> is(T d) { 
  return Is<T>{d}; 

The code example would then be like this:

auto predicate = [](State state) { 
  return is(state).in( { MyEnumClass::ValueA, 
                         MyEnumClass::ValueEWithAVeryLongName } ); 

That’s much better, but the curly braces inside the parameter are annoying. It would read much better this way and would be less typing, don’t you think?

auto predicate = [](State state) { 
  return is(state).in(MyEnumClass::ValueA, 

So this is my next attempt to solve it with variadic templates:

template <class T> 
struct Is 
  T d_; 
  bool in(T a) { 
    return a == d_; 
  template <class Arg, class... Args> 
  bool in(Arg a, Args... args) { 
    return in(a) || in(args...); 

template <class T> 
Is<T> is(T d) { 
  return Is<T>{d}; 

My next idea was, that there must be a way to do it with variadic templates without the recursion terminating bool in(T)  method.


So I played around a bit with Sean’s code, after I understood what it is actually doing, this is the result (thanks to cpplearner for the improvement hint):

struct Is {
 const T d_;
 template <class... Args>;
 bool in(Args... args) {
   bool r{ false };
   [](...){}(( (r = r || d_ == args), 1)...);
   return r;

template <class T>;
Is<lt> is(T d) {
 return Is<T>{d};

One disadvantage of this solution is, that the order of evaluation of the arguments is not defined.

But with Jay Miller’s comment, based on Eric Niebler’s improved version of the for_each_arg, this keeps the order of evaluation of the arguments.

template <class T>
struct Is {
  const T d_;
  template <class... Args>
  bool in(Args... args) {
    bool r {false};
    return (void)std::initializer_list<int>{ (r = r || d_ == args)... },r;

template <class T>
Is<T> is(T d) { 
  return Is<T>{d}; 


The last version is the most compact one, but it has the disadvantage compared to all the others, that the internal comparisons does not terminate early. So the code will compare all possible values, even a match was already found. As long as the value to be checked against the set of values cannot be evaluated during compile time, I don’t see a way to do it in a similar way like the last version. If you see one, please let me know.

Unfortunately the code does not fulfill Sean’s challenge: “Goal for Better Code: Fit each function in a tweet”. Never the less I think it is worth sharing it.

Since this is almost my very first experiment with variadic templates, all ideas for improvements or comments are welcome.



Please use “crayon” to enter source code in he comment. The “code” tag removes all “<” and “>”.

This code does not compile with Visual Studio 2013 update 3 in release mode, only in debug. It works fine with update 4 and VS2015 CTP and the recent Clang and GCC.


Oct 032014

James O. Coplien started a discussion in May 2014 about the value of UnitTests and why most of them are waste. In August he added the 2nd installment.

In this context I hear often the argument that the majority of tests should be UnitTests over all others. Mike Cohn suggests this as well with the layout of his Testing Pyramid, because UnitTests can be executed faster. Robert C. Martin (Uncle Bob) is a strong advocate of this too – see one of his recent blog entries. Later on I will come back to his blog post and his statement that a UnitTest framework must not slow down the developers’ pace. But first to the “argument” that UnitTests can be executed faster than the others:

When I talk in the following text only about End-To-End (E2E) tests, then as a pars pro toto for all kind of tests that check not just a single unit, but complex business logic or complete features.

So shall we write UnitTests “only” because they are executed faster than E2E tests? This sounds to me like some kind of a workaround. Because we cannot get easily execute broader applied tests fast, we test something that we can test faster? Exaggeratory, isn’t it somehow similar to the old joke below?


Continue reading »

New C++ Allocator Library on GitHub

 C++, Optimization, Software Development  Comments Off on New C++ Allocator Library on GitHub
Feb 142014

I have published my very first project on GitHub: Allocator Builder

From the summary:

A highly composable, policy based C++ allocator based on ideas from Andrei Alexandrescu, presented at the C++ and Beyond 2013 seminar.

The background behind the idea is to compensate the main problem of ::malloc() and the other standard allocators, the separation of memory pointer and the allocated size. This makes it very difficult for all kind of allocators to handle in a fast way memory allocations and deallocations.