Inferred Type for Explicit Cast

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Mon Dec 29 06:08:27 PST 2014


On Wednesday, 24 December 2014 at 03:11:40 UTC, Andrei 
Alexandrescu wrote:
> On 12/20/14 6:47 PM, Steven Schveighoffer wrote:
>> On 12/20/14 5:20 AM, Dicebot wrote:
>>
>>> I'd like to have a cast where you must define both "from" and 
>>> "to" types
>>> precisely.
>>
>> I was actually thinking the same thing. This would be almost
>> future-proof (any changes to either side would result in failed
>> compilation).
>>
>> -Steve
>
> Specifying two types instead of one in a "to" call should 
> achieve that. -- Andrei

This is different. `to` is about "smart" conversion (and 
potentially costly with allocations flying around) - we are 
speaking about same basic dumb cast here, just more controlled.


More information about the Digitalmars-d mailing list