Mail Archives: djgpp/1999/07/13/14:00:55
Siemel Naran wrote:
> >> I think that it is possible. Probably something along the lines of this:
> >> int (operator () *const)(int) { return &f; }
> >That gets a parse error before "*".
> Yes, I know. But I mean that the solution is something along the lines
> of this, where the "operator" keyword appears after the return type of
> the returned function. Kind of like for the member function returning
> a pointer to a non-member or class static function. I tried various
> combinations, all without any luck. Ask on comp.std.c++ as you might
> get an answer.
I'm beginning to think that it isn't possible. As someone already told me.
> Incidentally, how to make an array of function pointers using 'new'
> and without using 'typedef', and without using containers. With
> typedef, we say
I think this suffers from the same problem, and is impossible.
> > Thanx for the advice, but I'm not actually trying to use this construct,
> >I'm making a code parser and just wanted to know what to expect.
> Fine. If you don't know what to do just yet, just have your code
> parser reject this outright. I don't think anyone writes codes like
> this anyway.
Actually, what I'm going to do is accept any standard cast as an operator:
operator int (*)() ();
This isn't syntactically correct, but it should never arrise and it means I
don't have to make another type parser.
--
-Rolf Campbell (39)3-6318
- Raw text -