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


Florian Weimer wrote:
> * 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);

Yes, even if it is slightly different from the above because it does not
work if the constructor is explicit.

Giovanni Bajo


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