Meeting 5 April 2018

Jacksonville 2018 – C++20

April Fools, C++ edition

No, I’m not going to link to that.

STL on Twitter

# MSVC’s STL is 99% C++17 feature complete! In VS 2017 15.7, we’re shipping Filesystem, Parallel Algorithms (all signatures available, many actually parallelized, more later), constexpr char_traits (for string_view), Special Math, hypot(x, y, z), launder(), and Deduction Guides.

# 15.7 will contain a partial implementation of Elementary String Conversions in <charconv>: integers only. The floating-point part is the last STL feature that needs to be implemented. We’re also almost done with LWG issues: 33 added in 15.7, 14 done in future branches, 15 remain.

CLion 2018.1 released

  • Better C++17 support
  • Support for Clang-tidy configuration files
  • Produce Linux binaries on Windows
  • Built-in Valgrind memcheck in WSL
  • Open single file/folder without CMake
  • Breadcrumbs in the editor
  • Partial Git commits
  • Support for Rust, Fortran, Objective-C/C++

VisualAssistX

C++ auto-generated comparison operators

True parallelism, with no concept of threads - Alfred Bratterud - Meeting C++ 2017

Fibers, green threads, channels, lightweight processes, coroutines, pthreads - there are lots of options for parallelism abstractions. But what do you do if you just want your application to run a specific task on a specific core on your machine? In IncludeOS we have proper multicore support allowing you to do just that in C++: assign a task - for instance a lambda - directly to an available CPU. <…> In this talk we’ll <…> explore how direct per-core processing can be combined with threading concepts like C++14 fibers or coroutines, without taking away from the simplicity of getting work done uninterrupted.

Conclusions:

  • You don’t need classical threads to utilize CPU cores
    • Fibers and coroutines can run directly on them
  • A pthreads backend requires true blocking
    • Might require fibers, yielding directly to scheduler
  • Coroutines TS beats the simplest stack switch
  • Stackful coroutines would replace our fibers
  • Expect more multicore magic from IncludeOS

SwedenCpp - Arvid Norberg: Integers in C++

  • How undefined signed overflow enables optimizations in GCC
  • Guidelines for integers:
    • Signed: when you need normal arithmetic
    • Unsigned: flags, IDs, enumerations (enum class), bits
    • Avoid viral promotion of unsigned types wider than int
    • Avoid implicit sign conversions: -Wsign-conversion -Werror
1int32_t a = -1; uint32_t b = 1;
2if (a > b) std::cout << "wat"; // `a` --> 0xffffffff

C++20: Signed Integers are Two’s Complement

Video: Deep Learning with C++ - Peter Goldsborough - Meeting C++ 2017

C++ Memory Model

  • Part 1
    • Program order versus memory order
    • Atomic operations
    • Barriers
  • Part 2
    • A hardware model to explain acquire/release
    • Sequential Consistency

HPX v1.1 released

HPX is a general purpose parallel C++ runtime system for applications of any scale. It implements all of the related facilities as defined by the C++ Standard. <…> HPX provides the only widely available open-source implementation of the new C++17 parallel algorithms. Additionally, HPX implements <…> large parts of the C++ Concurrency TS, task blocks, data-parallel algorithms, executors, index-based parallel for loops, and many more.

As a C++ developer I think that Rust is…

Reddit

  • is a good language but the community is toxic towards people not using Rust
  • lacks function overloading, value generics, variadic generics and exceptions
  • is much nicer, though I doubt I’ll get to use it in my current job any time soon
  • solves a non-problem if you use modern C++
  • is a topic way too often spawning on this C++ subreddit
  • would have been a compelling alternative if it came out 10 years ago
  • lacks library support
  • less powerful but more user-friendly than C++

STL on Twitter

Simon Brand on Twitter