Closed mattkretz closed 7 years ago
Here's my thinking:
++where(m, vec)
should return where(m,vec)
where(m,vec)++
should return void (or, alternatively, something like where(m, copy-of-vec)
, but that's a strange beast, because "where" doesn't copy the datapar). So, the postfix operators are just cosmetics compared to the prefix operators, but some people might like postfix rather than prefix. So, let's keep them.
But ++x
is semantically the same as x += 1
, no? The latter returns void
for where expressions. I'd have both return void
and thus have pre and post be equivalent. It's the most conservative approach that is easiest to improve upon when going from TS to IS.
Fine with me. My point is that an operation on a where-expression (or a result thereof) should never magically drop the mask.
Good. Since my expectation would be a reference to the vector (i.e. to drop the mask), this proves my point that it must return void
. It's too ambiguous.
@jensmaurer:
Hmm, I don't recall why I deviated from
void
with increment and decrement. Probably because of the difference of pre-/post-increment. There would be no difference if the return type isvoid
. But maybe that's for the better anyway.If inc-/decrement return
void
, do you think I should drop post-dec/inc? I think not.