C++ reflection (P2996) and moc: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(Created page with "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 tha...")
 
mNo edit summary
Line 11: Line 11:
C++26 will (likely) ship with compile-time reflection. The papers that are relevant here are:
C++26 will (likely) ship with compile-time reflection. The papers that are relevant here are:


* P2996 "Reflection for C++26" <nowiki>https://wg21.link/p2996</nowiki>
* P2996 "Reflection for C++26" https://wg21.link/P2996
* P3394 "Annotations for Reflection" <nowiki>https://wg21.link/P3394</nowiki>
* P3394 "Annotations for Reflection" https://wg21.link/P3394
* P3096 "Function Parameter Reflection in Reflection for C++26" <nowiki>https://wg21.link/P3096</nowiki>
* P3096 "Function Parameter Reflection in Reflection for C++26" https://wg21.link/P3096
* P3491 " define_static_{string,object,array}" https://wg21.link/P3491
* P3491 "define_static_{string,object,array}" https://wg21.link/P3491

Revision as of 10:07, 27 May 2025

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: