Reflection without Reflection in C++ - Current Techniques and Possibilities
Offered By: Meeting Cpp via YouTube
Course Description
Overview
Explore advanced reflection techniques in C++ without relying on the Reflection TS in this 39-minute conference talk from Meeting C++ 2022. Discover ingenious methods to implement reflection using current C++ features, including template/function specialization, template argument deduction, and SFINAE. Learn how to count struct members, utilize structured bindings, and leverage std::tuple for struct reflection. Gain insights into clang's __builtin_dump_struct and even find out how to check if you're using tabs or spaces. Delve into these creative approaches that push the boundaries of C++ reflection capabilities while awaiting the official Reflection TS implementation.
Syllabus
Introduction
Template/function specialization
template argument deduction
Reflection technique #1: SFINAE
Quick refresher: What is SFINAE?
std::source_location::function_name
Struct reflection: counting the number of members
structured bindings
Struct reflection: std::tuple for struct's members
clang's __builtin_dump_struct
Checking if you are using tabs or spaces
Taught by
Meeting Cpp
Related Courses
Computer GraphicsUniversity of California, San Diego via edX Intro to Parallel Programming
Nvidia via Udacity Initiation à la programmation (en C++)
École Polytechnique Fédérale de Lausanne via Coursera C++ For C Programmers, Part A
University of California, Santa Cruz via Coursera Introduction à la programmation orientée objet (en C++)
École Polytechnique Fédérale de Lausanne via Coursera