casting int[] to bool[]
Jarrett Billingsley
jarrett.billingsley at gmail.com
Thu Jan 29 18:51:27 PST 2009
On Thu, Jan 29, 2009 at 8:46 PM, Steven Schveighoffer
<schveiguy at yahoo.com> wrote:
>
> This is such a common "mistake", and really more of an annoyance, I wonder
> if it might be better if pow were switched to a template that called the
> actual pow after casting the first argument to real. Often times, one does
> not use reals as their variable type, and I seem to recall this kind of
> error happens even with literals for both arguments...
>
> Something like:
>
> real pow(T, U)(T t, U u)
> {
> return _pow(cast(real)t, u);
> }
That's probably how it'd be written in modern D. Most of std.math is
probably 8 years old and pre-templates.
More information about the Digitalmars-d-learn
mailing list