Standard way to supply hints to branches

Walter Bright newshound2 at digitalmars.com
Tue Aug 27 21:21:24 UTC 2024


On 8/26/2024 10:39 PM, Manu wrote:
> Your suggestions could appear in almost every single at-least-warm function, and 
> it's not clear how they marry with eachother. We discussed 2 principle cases; 
> likely early return because of short-path or cached value, and unlikely early 
> return due to argument validation failure. Plenty of functions contain both 
> cases, and plenty of functions contain numerous such items.
> Try and imagine how your suggestion scales when there are 4-5 conditions that 
> need to be tested on function entry, and they don't all receive the same hint. I 
> value readable and maintainable code...

For reference, a real world example of your code?


More information about the Digitalmars-d mailing list