[Issue 3833] pure/nothrow functions/delegates are a subtype of the nonpure/throw ones
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Feb 2 10:17:56 PST 2011
http://d.puremagic.com/issues/show_bug.cgi?id=3833
--- Comment #2 from bearophile_hugs at eml.cc 2011-02-02 10:15:39 PST ---
This D2 program shows a cost of a strong type system: creating collections of
functions becomes a problem because there are so many attributes that change a
type. This specific problem is solved managing correctly variance/covariance of
function pointers and delegates, typing the array 'a' as an array of impure
nothrow @trusted functions:
import std.math;
void main() {
auto a = [&asin, &cbrt];
}
--
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