[macstl-dev] IIf function -- opinions wanted
glen.low at pixelglow.com
Wed Mar 9 07:38:35 WST 2005
John Terrell wanted a "merge conditional" function akin to Altivec's
vec_sel opcode (and the inbuilt C++ ternary logic operator ?:) to be in
the vec common interface, and I think it's a reasonable request for
0.2.2. Any takers for the name? So e.g.
iif (condition, true_clause, false_clause)
1. iif -- inspired by Visual Basic, somewhat terse though.
2. if_then -- seen this in Boost Lambda. However so far nothing in the
common interface has an underscore, so far.
3. if_then_else -- more explicit what it does
4. sel or select -- show its similarity to vec_sel, however may be
confusing as vec_sel (and thus altivec::sel) has a different order of
5. cond or condition -- doesn't read off as easily
The main focus of the common interface is to introduce functions that
do not require a thorough knowledge of the underlying SIMD
architecture, so a name that rings familiar to the target audience
would be best.
Cheers, Glen Low
pixelglow software | simply brilliant stuff
More information about the macstl-dev