Is this a bug in std.typecons.Tuple.slice?

tsbockman via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Feb 5 20:28:17 PST 2016


On Friday, 5 February 2016 at 19:16:11 UTC, Marco Leise wrote:
>> > 1. Removing 'ref' from the return type
>
> Must happen. 'ref' only worked because of the reinterpreting 
> cast which doesn't work in general. This will change the 
> semantics. Now the caller of 'slice' will deal with a whole new 
> copy of everything in the returned slice instead of a narrower 
> view into the original data. But that's a needed change to fix 
> the bug.

Actually, it's not: 
https://github.com/D-Programming-Language/phobos/pull/3973

All that is required is to include a little padding at the 
beginning of the slice struct to make the alignments match.


More information about the Digitalmars-d-learn mailing list