October 30, 2006 complex type associated with a float type? | ||||
---|---|---|---|---|
| ||||
Is there a built-in way to get the complex type associated with a given floating point type? I guess if x is some floating point variable I could say, alias typeof(x+0i) complex_t; is that the best bet? Thanks, --bb |
October 30, 2006 Re: complex type associated with a float type? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bill Baxter | Bill Baxter wrote:
> Is there a built-in way to get the complex type associated with a given floating point type?
>
> I guess if x is some floating point variable I could say,
>
> alias typeof(x+0i) complex_t;
>
> is that the best bet?
>
> Thanks,
> --bb
My first guess would be auto c = x+0i; and then using typeof(c)
|
Copyright © 1999-2021 by the D Language Foundation