C++ reflection (P2996) and moc

From Qt Wiki
Revision as of 10:07, 27 May 2025 by Peppe (talk | contribs)
Jump to navigation Jump to search

This is a WORK IN PROGRESS page to understand the implications of "Reflection for C++" for the future of Qt and moc.

Some questions that this work aims to answer:

  • Can we replace moc with a pure C++ solution?
    • If yes, how much source code breakage is to be expected?
    • Can porting be automated?
  • Is there something missing from standard C++ that we need for moc?

Reflection for Standard C++

C++26 will (likely) ship with compile-time reflection. The papers that are relevant here are: