On Thursday, April 05, 2012 14:58:41 Christophe wrote: > "Jonathan M Davis" , dans le message (digitalmars.D.learn:34243), a > > > Except that opSlice already works with "..". What would this buy you?
As I said, all it does is give you syntactic sugar for iota which can't even do as much as iota can (since it lacks a step parameter). But my point that you're quoting has nothing to do with using .. with functions in general. It specifically has to do with creating a new overload for opSlice as Jacob suggestios - i.e. when you do a[0 .. 5] where a is an instance of a user-defined type. That works just fine with auto opSlice (size_t start, size_t end). The range type buys you nothing for that, and in fact would be _more_ expensive, since it would have to allocate a struct rather than simply passing the two indices. - Jonathan M Davis
