September 25, 2001
As soon as I hit "Send" I realized I had a quibble.  Sorry for the double-post.

While I like the fact that GCC has this feature, and I like the fact that the syntax handles overloading well, I don't like the "feel" of the syntax.  I still think it should be a property.  Walter has said that there will be a property ".class or some such" (see "finding the class of an object" thread).  If we call it .typeof, then it works in many situations:

class Foo {};

struct { int a; int b; } bar(char *);

Foo a;
a.typeof b;
bar(char*).typeof retVal;


September 26, 2001
Russ Lewis wrote:
> 
> As soon as I hit "Send" I realized I had a quibble.  Sorry for the double-post.
> 
> While I like the fact that GCC has this feature, and I like the fact that the syntax handles overloading well, I don't like the "feel" of the syntax.  I still think it should be a property.  Walter has said that there will be a property ".class or some such" (see "finding the class of an object" thread).  If we call it .typeof, then it works in many situations:
> 
> class Foo {};
> 
> struct { int a; int b; } bar(char *);
> 
> Foo a;
> a.typeof b;
> bar(char*).typeof retVal;

Depending on how generics get implemented, this could be very useful. It might make some parts of generic programming a lot easier.

Dan
1 2
Next ›   Last »