Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Reflection without Reflection in C++ - Current Techniques and Possibilities

Meeting Cpp via YouTube

Overview

Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
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

Reviews

Start your review of Reflection without Reflection in C++ - Current Techniques and Possibilities

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.