How to represent struct with trailing array member

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jan 21 18:46:27 PST 2016


Dibyendu Majumdar:

On Thursday, 21 January 2016 at 21:52:06 UTC, Dibyendu Majumdar 
wrote:
> How should this be translated to D? Will D's array access allow 
> data elements to be accessed beyond the size declared?

Take a look at the code I've written here:
http://rosettacode.org/wiki/Sokoban#Faster_Version

You can also add a constructor to such struct, for safety and 
disallow default construction.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list