Skip to content

Commit

Permalink
Merge pull request #197 from leandro-lucarella-sociomantic/dep-cast-a…
Browse files Browse the repository at this point in the history
…rray-ulong

Add deprecation of cast T[] to ulong
  • Loading branch information
andralex committed Nov 19, 2012
2 parents 9129911 + 958bd81 commit b76201a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions deprecate.dd
Expand Up @@ -10,6 +10,7 @@ $(SPEC_S Deprecated Features,

$(TABLE2 Deprecated Features,
$(THEAD Feature, Spec, Warn, Dep, Error, Gone)
$(TROW $(DEPLINK Cast T[] to integral type), ?, N/A, 2.060, 2.061,  )
$(TROW $(DEPLINK Base Class Protection), 2.058, N/A, 2.058,  ,  )
$(TROW $(DEPLINK Using length in index expressions), ?, N/A, 2.041, 2.061,  )
$(TROW $(DEPLINK typedef), 2.057, N/A, 2.057,  ,  )
Expand Down Expand Up @@ -56,6 +57,19 @@ $(SPEC_S Deprecated Features,



<h3>$(DEPNAME Cast T[] to integral type)</h3>
At some point in time you could do:
---
ulong u = cast(ulong)[1,2];
---
To get the length of the array.
<h4>Corrective Action</h4>
$(P Use the $(LINK2 http://dlang.org/arrays.html#array-properties, .length) property instead.)

<h4>Rationale</h4>
$(P Using a cast to get the length of an array is just confusing.)



<h3>$(DEPNAME Base Class Protection)</h3>
Base class protections are things like:
Expand Down

0 comments on commit b76201a

Please sign in to comment.