D Beginner Trying Manual Memory Management

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jan 13 08:35:45 PST 2015


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

> On Tuesday, 13 January 2015 at 08:33:57 UTC, ketmar via 
> Digitalmars-d-learn wrote:
> > On Mon, 12 Jan 2015 22:07:13 +0000
> > aldanor via Digitalmars-d-learn 
> > <digitalmars-d-learn at puremagic.com>
> > wrote:
> >
> >> I see, thanks! :) I've started liking structs more and more 
> >> recently as well and been pondering on how to convert a 
> >> class-based code that looks like this (only the base class has 
> >> any data):
> > it's hard to tell by brief description. but having multiple 
> > inheritance
> > immediately rings an alarm ring for me. something is 
> > very-very-very
> > wrong if you need to have a winged whale. ;-)
> A real-world example: 
> http://www.hdfgroup.org/HDF5/doc/cpplus_RM/hierarchy.html
> 
> H5::File is both an H5::Location and H5::CommonFG (but not an 
> H5::Object)
> H5::Group is both an H5::Object (subclass of H5::Location) and 
> H5::CommonFG
> H5::Dataset is an H5::Object
i see something named "CommonFG" here, which seems to good thing to
move out of hierarchy altogether.

bwah, i don't even sure that given hierarchy is good for D. C++ has no
UFCS, and it's incredibly hard to check if some entity has some
methods/properties in C++, so they have no other choice than to work
around that limitations. it may be worthful to redesign the whole thing
for D, exploiting D shiny UFCS and metaprogramming features. and,
maybe, moving some things to interfaces too.
-------------- 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/9e8dd4d1/attachment.sig>


More information about the Digitalmars-d-learn mailing list