Boost logo

Boost :

Subject: Re: [boost] PCL - Portable C++ Library
From: Dominique Devienne (ddevienne_at_[hidden])
Date: 2012-02-10 09:14:43


On Fri, Feb 10, 2012 at 2:19 PM, Christof Donat <cd_at_[hidden]> wrote:
>>> Maybe a good Idea could be to try and get a cooperation with the Qt
>>> developers going, that aims to remove Qts dependencies on language
>>> Extensions (Object Meta Information and their own signal-slot mechanism)
>>> and replace them with solutions that are completelly done with C++11,
>>> like e.g. boost signals2 library.
>>
>> The Qt developers don't want to.
>
> So I guess, you have asked them.

FWIW, I remember reading in the Qt doc (or site) a rational for not
using pure C++ signal/slot designs. Can't find it again, but Mathias
is right in that Qt view's its MOC-based system as a feature, and not
a liability.

> Is there any interest in here to look into what we could learn from their design?

Well, just add introspection and reflection to C++ (possibly on-demand
instead of an all types and method for example), and the need for MOC
pretty much disappears. MOC is not just used for signal/slot, but for
introspectable properties, methods (and thus easy runtime integration
to JavaScript for example), declaring safe enums, and other stuff
still. Templates can "generate" code at compile time, but doing so is
not easy nor makes builds fast (to say the least)... C++ would have to
evolve a *lot* to replace MOC (or code-based code generators in
general).

With generalized code attributes added to C++11, I dream of a standard
way to perform source code transformation in the compiler itself, as
opposed to at a separate code-gen step, via a standardized AST and API
to manipulate it per TU. Using such facilities, adding introspection
and reflection becomes possible w/o having to be necessarily
standardized, at least initially. I guess you can do that with Clang
already, since it's OSS, but then you wouldn't be able to port that to
other compilers... --DD


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk