Meeting 10 January 2019

Post-San Diego

A Perspective on C++ Standardization in 2018

A Perspective on C++ Standardization in 2018 by JeanHeyd Meneide

You can roll your fantastic thing in your engine / application / middleware / scientific package? Awesome! Now write a specification for it.
  • The Rigor of Standardization
  • Surviving the Process (burnout)
  • The Composition of the C++ Standardization Committee

Articles on Ranges

How to Initialize a String Member

How to Initialize a String Member by B. Filipek

LazyCode

Making C++ cool again, bringing in those expressions from other languages that you wish you had; list comprehension style maps, filters, ranges, etc.

int total = lz::read<int>(ifstream("test.txt")) | lz::limit(10) |
            lz::filter([](int i) { return i % 2 == 0; }) |
            lz::map([](int i) { return i * i; }) | lz::sum();

Better Enums

#include <iostream>
#include "enum.h"

BETTER_ENUM(Word, int, Hello, World)

int main()
{
    std::cout << (+Word::Hello)._to_string() << ", "
              << (+Word::World)._to_string() << "!"
              << std::endl;

    return 0;
}

How to refurbish legacy code into a maintainable state

How to refurbish legacy code into a maintainable state by Jan Wilmans

  • Defensive programming
  • Owning raw pointers
  • Const correctness
    • Use override to detect interface changes after adding const
  • Smart pointers and RAII
    • Use custom destructor with std::unique_ptr
  • Tips and tricks
    • Easy logging from anywhere

C++, C# and Unity

C++, C# and Unity, by Lucas Meijer

Python-Like enumerate() In C++17

Python:

for i, thing in enumerate(listOfThings):
    print("The %dth thing is %s" % (i, thing))

C++:

std::vector<Thing> things;
...
for (auto [i, thing] : enumerate(things))
{
    // i gets the index and thing gets the Thing in each iteration
}

The Sleep Constructor

/img/the-sleep-ctor.png

Twitter

/img/programming-like-writing-book.png

Bjarne Meme

/img/bjarne-didnt-plan-for-this.png