Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2019-11-11 14:10:40


Phil Endecott wrote:
> If the compiler turns a sparse switch statement into an if-else-if chain,
> you might as well have an if-else-if chain in the first place (in terms of
> performance).

Compilers also turn an if-else chain into a switch:
https://godbolt.org/z/7fgSXH

In fact, I think that LLVM first turns the switch into an if-else chain, and
then back into a switch in a later pass.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk