void main() { import std.algorithm: map, cartesianProduct; auto seq = [1, 2].map!(x => x); foreach (pair; cartesianProduct(seq, seq)) {} } dmd 2.067alpha gives: ...\dmd2\src\phobos\std\algorithm.d(14489,20): Error: function std.algorithm.cartesianProduct!(MapResult!(__lambda1, Result), MapResult!(__lambda1, Result)).cartesianProduct.Result.save cannot get frame pointer to main ...\dmd2\src\phobos\std\algorithm.d(14489,20): Error: function std.algorithm.cartesianProduct!(MapResult!(__lambda1, Result), MapResult!(__lambda1, Result)).cartesianProduct.Result.save cannot get frame pointer to main ...\dmd2\src\phobos\std\algorithm.d(14489,20): Error: function std.algorithm.cartesianProduct!(MapResult!(__lambda1, Result), MapResult!(__lambda1, Result)).cartesianProduct.Result.save cannot get frame pointer to main ...\dmd2\src\phobos\std\algorithm.d(14489,20): Error: function std.algorithm.cartesianProduct!(MapResult!(__lambda1, Result), MapResult!(__lambda1, Result)).cartesianProduct.Result.save cannot get frame pointer to main Taking a look at the std.algorithm.cartesianProduct implementation: auto cartesianProduct(RR...)(RR ranges) if (ranges.length >= 2 && allSatisfy!(isForwardRange, RR) && !anySatisfy!(isInfinite, RR)) { ... static struct Result { ... @property Result save() { Result copy; // Error message here ******* foreach (i, r; ranges) { copy.ranges[i] = r.save; copy.current[i] = current[i].save; } copy.empty = this.empty; return copy; } } ... -----------------------
https://github.com/D-Programming-Language/phobos/pull/2860
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/51e390d0bbc764e2866b1fb4c1c3fc532f6f7537 Issue 13935: do not assume range can be default-initialized. When the incoming range is parametrized on something that requires a frame pointer, we cannot declare default-initialized instances of its type; to work around this in .save, just make a copy of `this` and then kick it into shape before returning it. https://github.com/D-Programming-Language/phobos/commit/9a655323a16585ba9dc9b3ae547d51123a4f4b9d Merge pull request #2860 from quickfur/issue13935 Issue 13935: do not assume range can be default-initialized.
Commits pushed to 2.067 at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/51e390d0bbc764e2866b1fb4c1c3fc532f6f7537 Issue 13935: do not assume range can be default-initialized. https://github.com/D-Programming-Language/phobos/commit/9a655323a16585ba9dc9b3ae547d51123a4f4b9d Merge pull request #2860 from quickfur/issue13935