Meeting 8 February 2018
Modules TS approved
Free book: C++ Notes for Professionals
The C++ Notes for Professionals book is compiled from Stack Overflow Documentation, the content is written by the beautiful people at Stack Overflow.
Book: Mastering C++ Game Development, by Mickey MacDonald
Simon Brand’s C++ tips on Twitter
Fact:
1struct a { void foo(); };
2struct b : a{};
3void b::b::b::b::b::b::a::foo(){}
That is valid code due to the “injected type name”.
Prefer templates or function_ref types to std::function
when you don’t need to own arbitrary callables. You pay for the flexibility std::function
gives you.
If you are careful std::shared_ptr<base>
can capture the correct deleter for derived
even if there’s no virtual destructor because it type-erases the deleter on construction.
C++ is not a strict superset of C. There is no such language as C/C++.
Some parts of C++ are hard for everyone and we all make mistakes.
CppCon 2017: Piotr Padlewski - Undefined Behaviour is awesome!
- MSVC emits messages from the backend instead of frontend. This means that the warnings you get depend on the optimisation level.
- UB allows the compiler to optimise away code that should not be
- Has there been a case of defining a previously UB?
Reflection in C++ Next - Anton Bikineev - Meeting C++ 2017
Slides (PDF) can be downloaded from SlideShare.
Code::dive Videos
CppCon 2017: James McNellis - Everything You Ever Wanted to Know about DLLs
Exporting C++ classes from DLLs: DON’T.
Compile-time String Obfuscator
GitHub (C++14) (MIT)
1#include <iostream>
2#include "str_obfuscator.hpp"
3
4int main(void)
5{
6 std::cout << cryptor::create("Hello, World!").decrypt()
7 << "\n";
8 return 0;
9}
Outcome accepted into Boost
Outcome is really an abstraction layer for setting per-namespace rules for when to throw exceptions. Exception throwing is absolutely at the heart of Outcome. That’s why Outcome != Expected, and why it ICEs older compilers, and why C++14 is needed.
Error handling can be done with exceptions, or with branch-testing on error instances; and some algorithms or constraints may favor one over the other for technical or compositional reasons.
The core of the dispute seems to be over the value of localized reasoning for handling errors: Exceptions are good for “distant” handling (to seamlessly transfer handling to a parent context), while explicit error/result instances (possibly customized) encourage local reasoning for discrete handling within the local algorithm context.
API & ABI versioning - Mathieu Ropert - Meeting C++ 2017
Spdlog: a very fast logging library
NLohmann/JSON: JSON for modern C++
Picobench: A micro microbenchmarking library for C++11 in a single header file
ComputeCpp 0.5.0 and SYCL 1.2.1
- Blog post by Codeplay
- Download
- SYCL is used in machine learning. ComputeCpp, Codeplay’s implementation of the SYCL standard can already be used to execute TensorFlow applications on SPIR OpenCL supported hardware.
- An ARM release of ComputeCpp is also now available and allows developers to target a range of embedded processors using SYCL.
CUTLASS by NVIDIA
A preview of CUTLASS (CUDA Templates for Linear Algebra Subroutines), a collection of CUDA C++ templates and abstractions for implementing high-performance GEMM computations at all levels and scales within CUDA kernels.
- Announcement
- GitHub (BSD-3-Clause)
HPX on a RasPI cluster
Clipp: command-line argument handler
Easy to use, powerful and expressive command line argument handling for C++11/14/17 contained in a single header file.
- GitHub (MIT)
Code snippet
Joe Groff (@jckarter), 02/02/2018, 18:15: Optional curly braces make C and C++ beautifully expressive
1switch (auto k{i}; true) do if (char j; i) default: ;
2else ; while (true);
GDC Programming Talks
Quote
The Programmers’ Credo: we do these things not because they are easy, but because we thought they were going to be easy