[Issue 5305] intrinsic functions have @safe stripped of them in release mode.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 20 12:17:19 PST 2012


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


Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at digitalmars.com


--- Comment #1 from Walter Bright <bugzilla at digitalmars.com> 2012-01-20 12:17:17 PST ---
For convenience, here's the example:

import std.math;

T[] map(T, V)(T function(T) f, V[] list)
{
    T[] result = new T[](list.length);

    foreach(k, v; list)
    {
        result[k] = f(v);
    }

    return result;
}

void main()
{
    assert (map!(real, float) (&sqrt, [4.0f, 9.0f]) == [2.0f, 3.0f]);
}

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


More information about the Digitalmars-d-bugs mailing list