More D newb questions.
BCS
ao at pathlink.com
Thu May 8 14:10:18 PDT 2008
Reply to Me,
> That depends upon the order (precedence) the transformation rules are
> applied.
> With the ordering shown above, your second example matched the first
> rule
> shown,
> and so is processed before it ever gets to the T ~ T -> T[].
> The first example fails to match on the first three rules and is
> processed
> according to the 4th
> and the result is consistant results.
> b.
>
You have just describe exactly why that code (from the programers's standpoint)
is somewhat inconstant
"T ~ T" can be of type T or T[] depending on what exactly T is. from the
programers standpoint this is inconstant. Template code becomes hard to working
with if the type of an expression starts having this type of dependency.
More information about the Digitalmars-d
mailing list