Funnies about C++ parsing - unhelpful error messages

Florian Weimer fw@deneb.enyo.de
Wed Sep 1 20:27:00 GMT 2004


* Giovanni Bajo:

>>         Bar<Foo<FooBar<int> > >(FooBar<int>()).operator()(x); // 21
>> }
>
> This is correct. Another way of writing this without the explicit call would
> be:
>
> ((Bar<Foo<FooBar<int> > >) (FooBar<int>())) (x);

This seams to be another possibility:

  static_cast<Bar<Foo<FooBar<int> > > >(FooBar<int>())(x);

Yet another reason to get rid of C-style casts, I suppose.



More information about the Gcc-patches mailing list