D Beginner Trying Manual Memory Management

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jan 13 10:49:09 PST 2015


On Tue, 13 Jan 2015 18:35:15 +0000
aldanor via Digitalmars-d-learn <digitalmars-d-learn at puremagic.com>
wrote:

> I guess two of my gripes with UFCS is (a) you really have to use 
> public imports in the modules where the target types are defined 
> so you bring all the symbols in whether you want it or not (b) 
> you lose access to private members because it's not the same 
> module anymore (correct me if I'm wrong?). Plus, you need to 
> decorate every single free function with a template constraint.
you can make a package and set protection to `package` instead of
`private`, so your function will still be able to access internal
fields, but package users will not. this feature is often missed
by the people who are used to `public`/`protected`/`private` triad.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20150113/2c7bdbfc/attachment.sig>


More information about the Digitalmars-d-learn mailing list