Properties no longer work?
Bruno Medeiros
brunodomedeirosATgmail at SPAM.com
Sun Jul 30 16:22:00 PDT 2006
Stewart Gordon wrote:
> Bruno Medeiros wrote:
>> Don Clugston wrote:
> <snip>
>>> Function types are just bizarre. I only recently discovered that C
>>> has them. Are you allowed to do anything with them, other than
>>> converting them to a function pointer by taking their address?
>>
>> C has them? Where did you see that, I was under the impression that C
>> only had function pointers, and they were all the same, such that the
>> value a function was the same as the value of taking the address of
>> the function:
>> (func) == (&func)
>> Similarly to what happens to arrays.
>
> I discovered quite recently that C supports such oddities as
>
> typedef int qwert(char*);
>
> (if I've got the syntax right), thereby defining qwert to be an alias
> for a function of type int(char*). I've seen it in the LAM MPI headers.
> But as you say, it seems useless - AFAIK the only thing you can do with
> it is declare something of type pointer to qwert.
>
> Stewart.
>
I've quite recently discovered that D supports that as well!
-> http://d.puremagic.com/issues/show_bug.cgi?id=270
But ah... there is a use for such a typedef after all. I thought they
could not be used in declarations at all, but forgot about declaring a
pointer to it. But still I don't know if they are worth the strange syntax.
--
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
More information about the Digitalmars-d-learn
mailing list