Adding properties/members to base types?

Bill Baxter dnewsgroup at billbaxter.com
Wed Sep 5 21:58:03 PDT 2007


Daniel Keep wrote:
> 
> Steven Schveighoffer wrote:
>> "Kirk McDonald" wrote
>>> This currently works only for the array types. It was proposed to 
>>> generalize it for all types.
>> Kirk,
>>
>> Thanks, that is where I read it.  For some reason I couldn't find it.  I 
>> hope it does get added, but only for basic types/enums, because allowing it 
>> for classes/structs would confuse the hell out of me :)  Not only would you 
>> have to look through class definitions/base classes, but also randomly 
>> placed functions to find out what the definition of some class property is.
>>
>> -Steve 
> 
> Heaven knows we don't have the exact same problem with free functions,
> since you can always tell where they're coming from.  And hell, you
> *always* have the ability to modify a class or struct's definition, so
> there's no reason to ever create a free function!
> 
> 	-- Daniel
> 
> 
> P.S.  For those that don't know me very well: :P

Point taken.  If you're sloppy about namespaces to begin with this will 
just make it worse.  If you're tidy, it'll be no problem because every 
such function you're using will have to be explicitly imported into the 
namespace.  Yet another reason static import should be the default.

--bb


More information about the Digitalmars-d-learn mailing list