[Interest] Is moc obsolete?

Konstantin Tokarev annulen at yandex.ru
Thu Jul 9 11:21:40 CEST 2015



09.07.2015, 08:25, "Thiago Macieira" <thiago.macieira at intel.com>:
> On Wednesday 08 July 2015 21:56:42 Konstantin Tokarev wrote:
>>  It does not support many C++ features:
>>
>>  http://www.copperspice.com/docs/cs_overview/moc_limits.html
>>
>>  However, in clang-based moc it would be possible to support all of this
>>  stuff
>
> No, it wouldn't. Not if you're thinking of a code generator moc that is run as
> a separate tool.
>
> The restrictions are not because of moc's implementation but because of the
> requirements imposed on the meta object.
>
> To lift those restrictions, we need a clang plugin that is run when compiling
> your code. THAT would be an extension to the C++ language (moc currently
> isn't).
>
> In other words, it would require implementing C++ reflection support. Please
> see the SG7 discussions inside the ISO C++ committee for more information on
> how soon it's coming (hint: it isn't).

Well, at least it could handle explicit instantiations of Q_OBJECT-based templates,
and issues with macros. I believe issues with multiple and virtual inheritance could be
solved by generating more "clever" meta-code using rich AST produced by clang.


>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

-- 
Regards,
Konstantin



More information about the Interest mailing list