This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Funnies about C++ parsing - unhelpful error messages
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: "Giovanni Bajo" <rasky at develer dot com>
- Cc: "Richard Guenther" <rguenth at tat dot physik dot uni-tuebingen dot de>, <gcc-patches at gcc dot gnu dot org>, <giovannibajo at libero dot it>
- Date: Wed, 01 Sep 2004 22:19:43 +0200
- Subject: Re: Funnies about C++ parsing - unhelpful error messages
- References: <Pine.LNX.4.44.0408311203160.9036-100000@alwazn.tat.physik.uni-tuebingen.de><08dd01c49047$5751e880$f503030a@mimas>
* 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.