How to use ".stringof" to get the value of a variable and not the name of the variable (identifier) itself?

Imperatorn johan_forsberg_86 at hotmail.com
Mon Oct 9 17:42:48 UTC 2023


On Monday, 9 October 2023 at 16:55:41 UTC, rempas wrote:
> On Monday, 9 October 2023 at 16:53:55 UTC, mw wrote:
>>
>> but you `import std.stdio;`?
>>
>> Or copy the std/conv.d over to your build,
>>
>> or copy / write a toString(int) function yourself, which is 
>> compile-time callable.
>
> I do on that example just to use "write". It wouldn't be 
> necessary, but I just included it. My normal project does not 
> use Phobos.

You could just add your own int to string I guess?


More information about the Digitalmars-d-learn mailing list