http://d.puremagic.com/issues/show_bug.cgi?id=5076



--- Comment #5 from Peter Alexander <peter.alexander...@gmail.com> 2010-10-19 
11:15:30 PDT ---
(In reply to comment #4)
> array creates an array from anything. We should have a way to say "duplicate
> and preserve type".
> 
> Probably the best idea is to define an optional property ".dup" for ranges.
> Then arrays implement it automatically, and other ranges may define it as they
> find fit.

What if you don't want to preserve type?

e.g. you have a list, but you want to get a sorted array of the elements in
that list?

Why not take the best of both worlds, allowing the user to specify the new
container type, but have it default to the original type, something like:

auto transformed(alias xform, OutputRange = InputRange, InputRange)(InputRange
range)
{
  ...
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to