[Qt-creator] parser bug(s)

Coda Highland coda at bobandgeorge.com
Mon Oct 26 19:49:52 CET 2009


On Mon, Oct 26, 2009 at 1:26 PM, Murphy, Sean M. <sean.murphy at gd-ais.com> wrote:
>> 1) There is a bug (in current snapshots too) with parsing code like
> the
>> following:
>>
>> c.f()(x)(y)(z);
>>
>> But, this is legal c++.
>
> Curious question of the day, what does the above line of code do?  I've
> never seen a C++ construct like that before!

c.f() returns a function pointer or a functor (either one works),
which is invoked with the parameter x; this function returns another
function pointer/functor, which is invoked with parameter y; this
function returns another pointer/functor which is invoked with
parameter z.

Basically, imagine this class:
class Functor {
public:
    Functor operator()(int param);
};

/s/ Adam




More information about the Qt-creator-old mailing list