
"Mathias Gaunard" wrote in message news:50D2F8D1.2030900@ens-lyon.org...
While this works, if you do this you won't be able to use lazy branch evaluation in the scalar version.
If you write
c = if_else(a != 0, b/a, b);
this is equivalent in scalar to
c = (a != 0) ? b/a : b;
except that in the case above you will always compute the division.
As mentinoned here https://github.com/MetaScale/nt2/issues/379, it should be (re)considered whether this scalar-if special handling actually brings any benefit (or it might actually even be a pessimization in the majority of cases)... -- "What Huxley teaches is that in the age of advanced technology, spiritual devastation is more likely to come from an enemy with a smiling face than from one whose countenance exudes suspicion and hate." Neil Postman