CTFE Status 2

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Tue May 16 06:44:27 PDT 2017


On Thursday, 16 February 2017 at 21:05:51 UTC, Stefan Koch wrote:
> [ ... ]

So ...
I just encountered more ABI issues; related to slices which are 
part of structures.
struct R
{
   uint[] s1;
   uint[] s2;
}

like this.

R returnSlices(int[] s1, int[] s2)
{
     return R(s1[], s2[]);
}
static assert(returnSlices([1,2,3], [4,5,6,7]) == 
R([1,2,3][4.5.6.7])); // works


R returnSlicedSlices(int[] s1, int[] s2)
{
     return R(s1[], s2[1 .. $-1]);
}
static assert(returnSlicedSlices([1,2,3], [4,5,6,7]) == 
R([1,2,3],[5,6])); // fails
// returns R([1,2,3],null); at the moment

The reason ABI issues.
Where exactly ? No Idea.




More information about the Digitalmars-d mailing list