opCast'ing strings

Adam D. Ruppe destructionator at gmail.com
Mon Nov 13 01:12:59 UTC 2017


On Monday, 13 November 2017 at 01:03:17 UTC, helxi wrote:
> In this program, casting using to does not work as intended 
> (returning 23/11) on the struct. However, calling opCast 
> directly seems to do the job. Why is that?


to!string calls a function called `string toString() {}` on the 
struct, not the cast operator.


More information about the Digitalmars-d-learn mailing list