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


David Simcha <dsim...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dsim...@yahoo.com


--- Comment #1 from David Simcha <dsim...@yahoo.com> 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
std.range:

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: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to