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
andstd::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 conceptstd::swappable
and the type-traitstd::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 thatis_empty_v<C>
istrue
, and yetsizeof(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:
- “C++ Pub Quiz at CppCon 2019” (2019-09-21)
- “C++ Pub Quiz at CppCon 2020, Game One” (2020-09-16)
- “C++ Pub Quiz at CppCon 2020, Game Two” (2020-09-18)
- “C++ Pub Quiz at CppCon 2021, Game One” (2021-10-28)