This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Funnies about C++ parsing - unhelpful error messages


* 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]