C++ Pub Quiz at CppCon 2021, Game Two

Last night I emceed Game 2 of CppCon 2021’s “C++ Pub Quiz.” This time, five teams participated, and the results were again pretty close: In first place, the ironically named Team Dead Weight with 29.5 points, followed by decltype([](){}) at 28 and the Metaprogrammers at 27. Thanks also to the Leftovers and the Abominable Types.

There was some doubt as to whether the decltype([](){}) who played in Round 1 should really be considered the same team as the decltype([](){}) who played in Round 2, or whether it should be considered a new unique team in each round. However, ultimately, no diagnostic was given.

Remember last year’s brainstorm round, in which the scores (out of a possible 14 points) ranged from 9 down to −3? This year’s brainstorm round was:

In the C++20 standard library, there are exactly 12 identifiers “foo” such that the library provides both std::foo and std::is_foo. Name as many of these identifiers as you can. For example, you can all go ahead and write “swappable” as your first answer, because C++20 provides both the concept std::swappable and the type-trait std::is_swappable. Your score for this round will be the number of names you give correctly, minus the number you give incorrectly (if any).

The five teams’ scores for this round ranged from 4 to −4. Can you do better?

Another noteworthy question:

Write a translation unit containing a class type C, such that is_empty_v<C> is true, and yet sizeof(C) is greater than 1.

No team used the approach that I had had in mind, but several teams won points by taking an alternative (yet valid) approach I hadn’t thought of!


Thanks to all the pub quizzers for making C++ Pub Quiz a success — and of course thanks to Herb Sutter, Jon Kalb, and everyone behind the scenes for making CppCon in general a success this year.


See also:

Posted 2021-10-29