array literal element types

Bill Baxter wbaxter at gmail.com
Thu Nov 12 13:53:35 PST 2009


On Thu, Nov 12, 2009 at 1:42 PM, Walter Bright
<newshound1 at digitalmars.com> wrote:
> Currently, the type is determined by the type of the first element and the
> rest are implicitly cast to it.
>
> I propose changing it to being the type produced by applying the ?: logic
> repeatedly to all the elements.
>

Yay!
But if you want to force a type will there be a way to do that too
without casting each item?
like
   cast(int[]) [2.0, 4.5, 6.7]

Maybe that works already?

--bb



More information about the Digitalmars-d mailing list