[OT] Checked opCast
Ola Fosheim Grøstad via Digitalmars-d
digitalmars-d at puremagic.com
Sat Jul 2 23:28:00 PDT 2016
On Sunday, 3 July 2016 at 00:57:04 UTC, Timon Gehr wrote:
> How do you decide what 'redundant work' is? Is this combination
> of branches and type casts really particularly cheap to execute?
He just provided an example, so preserving the essence of the
logic for all kinds of U and T is important. The sizeof test is
flawed in general (it does not reflect the maximum for all types
on all hardware).
The question was more whether "break" usually is more clear and
performant for this type of code. And the answer is no...
More information about the Digitalmars-d
mailing list