Set Operations on Set-like Containers

2016-11-02 Thread Nordlöw via Digitalmars-d-learn
Does https://dlang.org/phobos/std_algorithm_setops.html support specializations when (some) arguments are containers/ranges that provide the `in` operator? Typically set- and map-like containers with O(1) key membership checking. If not, should they? And what about operator overloading fo

Re: Set Operations on Set-like Containers

2016-11-02 Thread Nordlöw via Digitalmars-d-learn
On Wednesday, 2 November 2016 at 13:45:41 UTC, Nordlöw wrote: Typically set- and map-like containers with O(1) key membership checking. A typical use case is intersection of the two sets `x` and `y`. When `x` and `y` both support O(1)-`contains(e)` the preferred algorithm is to interate over

Re: Set Operations on Set-like Containers

2016-11-02 Thread Andrei Alexandrescu via Digitalmars-d-learn
On 11/02/2016 11:07 AM, Nordlöw wrote: On Wednesday, 2 November 2016 at 13:45:41 UTC, Nordlöw wrote: Typically set- and map-like containers with O(1) key membership checking. A typical use case is intersection of the two sets `x` and `y`. When `x` and `y` both support O(1)-`contains(e)` the p