I am completely certain that if I proposed deref coercions today there would be a crowd up in arms about how important it is that they know that the address-of and period operators don't run arbitrary code.
-
-
In practice, the fact that Deref has to return &T, not some arbitrary T, is a huge limitation on how much magic can be there. It certainly makes my life harder when implementing Deref on SIMD types, for instance.
-
Note that I’m not suggesting that Deref be expanded to allow returning non-references. Rather I’m pointing out that Deref’s design is *already* very conservative. Deref was an exercise in language design *restraint*, from my point of view.
- 5 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.