This event has ended. Visit the official site or create your own event on Sched.
Back To Schedule
Friday, September 29 • 1:30pm - 2:30pm
Compile-time reflection, Serialization and ORM Examples

Log in to save this to your schedule, view media, leave feedback and see who's attending!

Feedback form is now closed.
We will discuss what reflection is and how it can be implemented in Modern C++. The techniques used will include a mix of C++11/14 features (void_t, tuple, index_sequence, variadic templates, auto functions, decltype(auto), constexpr, type_traits, etc), classic C++ features, and macros.

We’ll use a couple of example libraries to show the essence and power of compile-time reflection and show how to simplify and improve their implementation with C++17 features such as inline variables, constexpr if, structure binding, fold expressions, and string_view.

The first example is a library that can serialize a struct into any of a variety of data formats, such as JSON, XML, MessagePack, or a custom format.

We’ll then apply the same techniques to implement an Object-Relational Mapping (ORM) library to serialize structs into the tables of any of a variety of databases, such as SQLite, MySQL, Postgres, etc.

We’ll discuss some of the challenges and limitations of these techniques and what features could be added to C++ to improve support for compile-time reflection.

avatar for Yu Qi

Yu Qi

Technical Director, oneflow
Yu is a C++ programmer with 10 years experience who lives in Zhuhai, Guangdong province, China. He loves modern C++ and has founded an open source community ( http://www.purecpp.org/ ) to promote C++11/14 in China. His focus is distributed systems and he is the author of rest_rpc... Read More →

Friday September 29, 2017 1:30pm - 2:30pm PDT
Ferranti (403) Meydenbauer Center