CppCon 2018 has ended
Back To Schedule
Tuesday, September 25 • 15:50 - 16:20
Teaching Old Compilers New Tricks: Transpiling C++17 to C++11

Sign up or log in to save this to your schedule, view media, leave feedback and see who's attending!

With all the new features C++14 and C++17 offer, it can be frustrating to be stuck with an old compiler that doesn't support them yet. Instead of forgoing structured bindings, fold expressions, and other additions, what if we could use them even on pre-2014 compilers?

Enter clang-from-the-future, a transpiler that reads C++17 programs and outputs standard C++11 source code. When used as a preprocessing step, it allows any compiler with C++11 support to compile a subset of C++14/17 programs. To enable this, CTFT rewrites new language features based on the program's abstract syntax tree and provides drop-in implementations for standard library additions.

In this talk, I will show how specifically this is achieved, how well it works in practice, and what's left to be done in the future.

The source code for CFTF can be downloaded here: https://github.com/neobrain/cftf

avatar for Tony Wasserka

Tony Wasserka

Low-level anything: Tony is a consultant and long-term C++ enthusiast who has worked on the console emulator projects Dolphin (GameCube/Wii), PPSSPP (PSP), and Mikage (3DS) since 2010. More recently, he has worked on Vulkan graphics drivers for PowerVR graphics processors. His main... Read More →

Tuesday September 25, 2018 15:50 - 16:20 PDT
Steamboat (403)