Skip to content

DanielaE/CppInAction

Repository files navigation

CC BY-SA 4.0

CppInAction

Demo Code for presentation "Contemporary C++ In Action"

This code does not compile without the missing pieces (the precompiled modules mentioned in the code) because it is for educational purposes only. Besides that it is complete.

The missing pieces are:

  1. Asio, preferably non-Boost Asio
  2. libav FFmpeg
  3. SDL2 SDL
  4. argparse argparse
  5. modularized standard library

I have forked

  1. Asio, branch 'module'
  2. SDL2, branch 'module'
  3. argparse, branch 'module'
  4. libav, branch 'module'

plus

  1. a modularized standard library with a polyfill for the missing, not yet implemented parts: std.module

which contain the necessary changes to compile Asio, SDL, libav, and argparse as modules. My take on the C++ standard library module adds Casey Carter's current implementation of <generator>, plus my implementation of <print> and a partial implementation of C++26's explicit lifetime management P2590 on top of the standard library that comes with the compiler toolset of your choice.

There is also a minimum set of sources from FFmpeg v6.0 to compile module libav. You need to provide the necessary link libraries yourself if you want to build the executable.

The videos of the keynote presentations are here:

Building the app

Windows

Update 4 or better is highly recommended.

  • open a VS2022 command line window
  • cmake -B bld-msvc -G Ninja -Wno-dev -DCMAKE_CXX_STANDARD=23 --fresh
  • ninja -C bld-msvc

MSYS2 (UCRT64)

Clang 16.0.2 or better is required.

  • open a MSYS2 window
  • export CC=clang
  • export CXX=clang++
  • cmake -B bld-clang -G Ninja -Wno-dev -DCMAKE_CXX_STANDARD=23 -DCMAKE_CXX_FLAGS="-stdlib=libc++" --fresh
  • ninja -C bld-clang

Linux

Clang 16.0.2 or better is required. Clang 17 is recommended.

  • open a terminal window
  • export CC=clang-1x
  • export CXX=clang++-1x
  • cmake -B bld -G Ninja -Wno-dev -DCMAKE_CXX_STANDARD=23 -DCMAKE_CXX_FLAGS="-stdlib=libc++" --fresh
  • ninja -C bld

License

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

CC BY-SA 4.0

About

Demo Code for presentation "C++ In Action"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published