std.container & ranges

Jacob Carlborg doob at me.com
Thu Nov 3 05:17:35 PDT 2011


On 2011-11-03 08:41, Mike Parker wrote:
> On 11/2/2011 10:41 PM, Steven Schveighoffer wrote:
>>
>
>> Then your specific application can use std.algorithm.find to implement
>> the equivalent. Only the algorithm body changes, not the usage of the
>> algorithm.
>>
>
> This is the root of the problem. How are we supposed to know that we
> need something from std.algorithm to remove something from a container
> in std.container? It's non-intuitive and non-obvious unless you already
> have more than a passing familiarity with ranges. If we can't have
> remove(element) on a container, then we need some good documentation in
> the std.container module that points the way.

What about having a remove method on a container that calls remove in 
std.algorithm, just as a convenience.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list