Beta 2.108.0
Andrea Fontana
nospam at example.org
Thu Mar 21 09:16:07 UTC 2024
On Thursday, 21 March 2024 at 03:19:16 UTC, Salih Dincer wrote:
> On Thursday, 21 March 2024 at 02:14:36 UTC, WebFreak001 wrote:
>> On Saturday, 2 March 2024 at 17:40:29 UTC, Iain Buclaw wrote:
>> .. since they drastically make things easier (hexstrings) or
>> even possible in the first place (magic initializer thingies)
>> for library code and generated code.
>
> I cannot say the same thing. It is thought-provoking that even
> the toHex() function, which should be in std.conv, was not
> included and we had to write it ourselves.
>
> SDB at 79
This?
```
import std;
void main()
{
int number = 32409;
auto hex = format("%X", number);
writeln(hex);
}
```
or:
```
auto toHex(N)(N number) if (isIntegral!N) { return
"%X".format(number); }
...
auto hex = 3432.toHex();
...
```
More information about the Digitalmars-d-announce
mailing list