Re: Can I write a recursive type definition ?
From: Michael Mair (mairRemove_for_mailinG_at_ians.uni-stuttgart.de)
Date: 10/05/04
- Next message: pete: "Re: strncmp(a,b,0)"
- Previous message: pete: "Re: strncmp(a,b,0)"
- In reply to: Timothy Madden: "Re: Can I write a recursive type definition ?"
- Next in thread: Tom Widmer: "Re: Can I write a recursive type definition ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 05 Oct 2004 12:39:05 +0200
Hi Timothy,
[Timothy Madden:]
>>>Does anyone think that there should be a special class of "void code
>>>pointes" in C/C++ ?
>>>A kind of pointer that could only be assigned function addresses,
>>>without the pointer being of a specific function type.
>>
[Victor Bazarov:]
>>What problem would you solve with it that cannot otherwise be solved
>>with what C++ already has?
>
[Timothy Madden:]
> Well ... It's like 'what problem would I solve with C++ that cannot
> otherwise be solved with what C already has ?'
I think the question here is what kind of "problem" we are talking
about. We could throw out some stuff from C and would still be able
to solve the same problems.
OTOH, C++ often speeds up development. And I think that it is here
that there is no bottleneck and no obvious gap which this addition
would help do away with. IMO, that is what Victor was addressing.
> I think this could help making things clear in a good program
How so? You would get yourself function pointers without type
which would make it extremely hard to be sure that you are
calling a nondescript function correctly. IMO, a "collection" of
functions with the same return type and parameter list is the
only sensible case for the use of a function pointer. It is
clearer to provide wrapper functions for functions who do not
exactly fit than to have to take care which function now is
"behind" the "void *"-like function pointer.
Even if you could somehow derive return type and parameter list,
the code would not necessarily become clearer.
Cheers
Michael
- Next message: pete: "Re: strncmp(a,b,0)"
- Previous message: pete: "Re: strncmp(a,b,0)"
- In reply to: Timothy Madden: "Re: Can I write a recursive type definition ?"
- Next in thread: Tom Widmer: "Re: Can I write a recursive type definition ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|