ConcurrentHashSet
ConcurrentHashSet copied to clipboard
Added additional overload of Add which includes out parameter
Please link to https://github.com/i3arnon/ConcurrentHashSet/issues/14
I expected the out parameter to only return the existing value if it was there and default otherwise.
This is usually the pattern with a bool returning method with an out result (e.g. TryGetValue)
That makes sense for 'Try' type methods, but I think in the case where we are always dealing with a method that will succeed, the meaning of the out parameter is different, and that is OK.
Another option could be to have another method e.g. AddAndGet which returns a Tuple.