Skip to content

Practical Code Examples: Static Reflection in C++17

Photo of Ryan Toll
Hosted By
Ryan T.
Practical Code Examples: Static Reflection in C++17

Details

This series will explore interesting work by various members of the group. Individuals will have a chance to share elements of real production examples, personal projects, or hobby explorations that may be of general interest to the group. Others will then have a chance to ask questions regarding that topic.

We will hear a short, informal presentation from Ryan Toll regarding a form of static reflection in C++17. He used this technique to generate more efficient serialization/deserialization code for arbitrarily complex types in real production code. This was then combined with the Curiously Recurring Template Pattern (CRTP) to allow consumers to easily "mix-in" this functionality into a class with only modest setup. Further functionality could then be created with this infrastructure in place. Similar techniques were extended using the Barton–Nackman Trick to inject free functions for binary operator== and operator!= using a similar CRTP mix-in methodology.

A code sample is provided below for examination. Please review the code before the event as presentation tools will be very limited. Ryan will be available to answer questions during the dinner.

https://github.com/ryantoll/Static-Reflection-Example-Serialization-And-Comparison

Location:
City Barbeque
9424 Falls of Neuse Rd, Raleigh, NC 27615

Photo of Triangle C++ Developers Group group
Triangle C++ Developers Group
See more events
Needs a location