Casting MapResult

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jun 15 10:52:27 PDT 2015


On Mon, 15 Jun 2015 17:07:55 +0000, jmh530 wrote:

> I have a little bit of a follow up.
> 
> After making the recommended changes, the function seems to work with
> both static and dynamic arrays. I then noticed that all of the examples
> for functions that pass arrays in http://dlang.org/function.html use the
> dynamic array notation like my function above. Does this matter?

it doesn't, but i'd use `[]` anyway for code readability. static arrays 
can be converted to slices by the compiler when it needs to, but by using 
explicit `[]` it's easy to see if function expects slice or "real static 
array" right in the call site, without looking at function signature.
-------------- 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/20150615/bc2c4fc2/attachment.sig>


More information about the Digitalmars-d-learn mailing list