Le 25/11/10 14:03, biozic a écrit :
Hello.Trying to answer to myself: This is because std.algorithm.endsWith, startsWith, etc. expect their first argument to be an InputRange (checked with isInputRange), and an immutable array cannot be an InputRange (because of immutability). I think several algorithms could either tolerate an Iterable (checked with std.traits.isIterable) as their first argument or be specialized for immutable arrays. It is the case of topNCopy for instance. As for bug #5134: since a function argument with the 'in' "storage class" is const, it cannot be an InputRange, so compilation fails... Am I right? Thanks, Nicolas |
- Some algorithms on immutable data: bug 5134? biozic
- Re: Some algorithms on immutable data: bug 5134? biozic
