On Mar 14, 2012, at 11:34 AM, Matt Joiner wrote:

There's still a performance cost in looking up the already present value a second time.

The performance cost is near zero.  The relevant memory accesses with be in cache (which make accessing them almost free).

Besides, the price you pay for storing and testing the boolean value isn't free either.  

Thinking like a C programmer won't help you in the optimization game with sets.
And, it's certainly not worth complexifying the API.


P.S.  There have been previous threads on this same subject and they've all ended with rejecting the proposal.