What is the difference between cast(T)x and to!T(x) in D programming language? (provided that the module std.conv is imported)
What is the difference between cast(T)x and to!T(x) in D programming language? (provided that the module std.conv is imported)
cast(T)x does a few types of conversions as guaranteed by the language. These include:
alias this conversion that would otherwise not be forcedconst and sharedto!T(x) does a number of other conversions, most notably to and from strings.