David Simcha <> changed:

           What    |Removed                     |Added
                 CC|                            |

--- Comment #1 from David Simcha <> 2010-08-16 20:08:44 PDT ---
The issue I see here is that, since static arrays are usually stack allocated,
using them as ranges is inherently unsafe.  Even in cases where it seems safe,
the predicate may do weird things like escape the static array.  I think the
generic programming issue can be solved by simply having an unsafe function in

auto toRange(R)(ref R stuff) if(isInputRange!R) {
    static if(isStaticArray!R) {
         return stuff[];
    } else {
        return stuff; 

Of course, I'd also create an overload w/o the ref so it works with rvalues. 
Sound good?

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to