Meeting 11 July 2019

Elements of Programming Authors' Edition (free ebook)

Alex Stepanov and Paul McJones have just released Elements of Programming Authors’ Edition.

PDF download:

C++17 - The Complete Guide by Nicolai Josuttis

CLion 2019.2 EAP: MSVC Debugger, Unused Includes Check, and More

  • Experimental feature: LLDB-based Debugger for the Microsoft Visual C++ toolchain
  • The ‘unused includes’ check is back
  • Memory view: ASCII view
  • Better performance for code completion

Serenity OS Patterns: The Badge

(aka The Client-Attorney Idiom)

template<typename T>
class Key { friend T; Key(){} Key(Key const&){} };
class Foo;
class Bar { public: void special(int a, Key<Foo>); }; // protected API
class Foo { public: void special() { Bar().special(1, {}); } };

// At call site
Foo().special();      // OK
Bar().special(1, {}); // Error: Key<Foo> ctor is private

Catching use-after-move bugs with Clang's consumed annotations

Article by Andreas Kling | Reddit

class [[clang::consumable(unconsumed)]] CleverObject {
  CleverObject() {}
  CleverObject(CleverObject&& other) { other.invalidate(); }
  void do_something() { assert(m_valid); }
  void invalidate() { m_valid = false; }
  bool m_valid { true };

The Power of Hidden Friends in C++

Article by Anthony Williams

namespace A{
  class X{
    X(int i):data(i){}
    int data;
    friend bool operator==(X const& lhs,X const& rhs){

How to try the new coroutines TS?


/await /std:c++latest


-std=c++2a -stdlib=libc++ -fcoroutines-ts

Discussion: member variable naming

  • m_foo
  • foo_
  • _foo