Am Sat, 06 Feb 2016 04:28:17 +0000
schrieb tsbockman <thomas.bock...@gmail.com>:

> 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.

I don't want to sound dismissive, but when that thought came
to my mind I considered it unacceptable that the type of
Tuple!(int, bool, string).slice(1, 3) would be something
different than Tuple!(bool, string). In your case
Tuple!(TuplePad!4LU, bool, string). That's just a matter of
least surprise when comparing the types.

I'll let others decide, since I never used tuple slices.

-- 
Marco

  • Is this a bug in std.typecons... Saurabh Das via Digitalmars-d-learn
    • Re: Is this a bug in std... Saurabh Das via Digitalmars-d-learn
      • Re: Is this a bug in... Marco Leise via Digitalmars-d-learn
        • Re: Is this a bu... Marco Leise via Digitalmars-d-learn
          • Re: Is this ... Saurabh Das via Digitalmars-d-learn
          • Re: Is this ... Saurabh Das via Digitalmars-d-learn
            • Re: Is ... Saurabh Das via Digitalmars-d-learn
            • Re: Is ... Saurabh Das via Digitalmars-d-learn
              • Re:... Marco Leise via Digitalmars-d-learn
                • ... tsbockman via Digitalmars-d-learn
                • ... Marco Leise via Digitalmars-d-learn
                • ... tsbockman via Digitalmars-d-learn
                • ... Marco Leise via Digitalmars-d-learn
                • ... tsbockman via Digitalmars-d-learn
                • ... tsbockman via Digitalmars-d-learn
                • ... tsbockman via Digitalmars-d-learn
                • ... Saurabh Das via Digitalmars-d-learn
                • ... tsbockman via Digitalmars-d-learn
                • ... Marco Leise via Digitalmars-d-learn
                • ... tsbockman via Digitalmars-d-learn
                • ... Ola Fosheim Grøstad via Digitalmars-d-learn

Reply via email to