http://d.puremagic.com/issues/show_bug.cgi?id=4571
--- Comment #6 from bearophile_h...@eml.cc 2012-10-01 14:26:20 PDT --- A small program that shows three important things std.typecons.Nullable isn't able to do: import std.stdio, std.algorithm, std.typecons; alias Nullable!(int, -1) Position; void foo(int[] a, Position pos) /*nothrow*/ { // allow this to be nothrow if (pos.isNull) { return; } else { a[pos] = 10; // perform no nullness test here, optimization } } void bar(int[] a, Position pos) { a[pos] = 10; // compile-time error here? } void main() { auto data = [1, 2, 3, 4, 5]; auto p = Position(countUntil(data, 7)); foo(data, p); writeln(data); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------