__property keyword support in GCC
Martin v. Loewis
martin@loewis.home.cs.tu-berlin.de
Fri Dec 31 23:54:00 GMT 1999
> Parsing the declaration of a property type is, as you say, relatively
> simple. But the main work would be the appropriate handling of property
> symbols in all contexts, including all the contexts where they don't make
> sense (attempts to create pointers or references to a property, etc)
Just to extend this list somewhat: When defining the extension, you'll
have to explain:
- access control: if the property is private or protected, does it
matter, or is it the access of the referred-to property that
matters?
- inheritance 1: can the derived class redefine a property defined in
the base?
- inheritance 2: can a property defined in a derived class refer to
accessor functions in the base class?
- inheritance 3: can a property defined in the base class refer to
accessor functions in the derived class (e.g if the accessor
function is redefined)
- virtuality: If the accessor function is virtual, which function is
invoked? Probably the one in the most-derived type. Is there a way
to cancel virtual using qualification?
- typing: What is the type of the property? Probably the type of the
accessor functions. Can those process different types (e.g. read
returns one type, write consumes another)
- typing and overloading: If there is more than one accessor function
with a given name, which one is selected?
- passing by reference: Is a property an lvalue, if it has read and
write? If so, how exactly are accessor functions invoked?
- constness: If an object is const, does this affect availability of
accessor functions? If so, how?
I guess there are more. I have no plans of implementing the feature,
so there is no real reason to explain all the details to me.
Regards,
Martin
More information about the Gcc
mailing list