--
struct Set(alias less = "a < b", T)
{
import std.algorithm;
import std.functional;
alias lessFun = binaryFun!(less);
int[] someContents;
this(R)(R r)
{
sort!(lessFun)(someContents);
}
}
unittest {
auto as2 = Set!((x,y) => x < y , int)([2, 1, 3]);
}
-- http://dpaste.dzfl.pl/af6cb1a8d8ab
It works, if I provide a normal function or a string lambda as
'less'. However the code above results in the following error:
/d923/f233.d(11): Error: constructor
f233.__unittestL15_3.Set!((x, y) => x < y,
int).Set.__ctor!(int[]).this cannot get frame pointer to sort
What's wrong?
May be related to #5710
Comment #1 by briancschott — 2014-12-11T23:39:17Z
I'm seeing this issue show up in EMSI's codebase after the change to cartesianProduct introduced in https://github.com/D-Programming-Language/phobos/pull/2276.
The following is an example error message that I get when building with 2.067.0-b1:
/home/brian/programs/dmd2/linux/bin64/../../src/phobos/std/algorithm.d(13226): Error: function std.algorithm.cartesianProduct!(MapResult!(__lambda2, Result), MapResult!(__lambda2, FilterResult!(__lambda3, HierarchyRefRange)), MapResult!(__lambda2, Result)).cartesianProduct.Result.save cannot get frame pointer to ids
Comment #2 by briancschott — 2014-12-12T01:29:37Z
Another test case:
---
module test;
import std.algorithm;
struct DummyRange
{
auto opSlice()
{
int[] ints;
return ints.map!(i => i);
}
}
void main()
{
DummyRange r1, r2, r3;
auto r = cartesianProduct(r1[], r2[], r3[]);
}
---
Comment #3 by dlang-bugzilla — 2017-07-03T18:16:06Z