On Friday, 24 June 2022 at 03:03:52 UTC, Paul Backus wrote:
On Thursday, 23 June 2022 at 21:34:27 UTC, Ola Fosheim Grøstad wrote:
On Thursday, 23 June 2022 at 21:05:57 UTC, ag0aep6g wrote:
It's a weird rule for sure.

Another slightly annoying thing is that it cares about destruction order when there are no destructors.

If there are no destructors the lifetime ought to be considered the same for variables in the same scope.

Having different lifetime rules for different types is worse UX than having the same lifetime rules for all types.

Imagine writing a generic function which passes all of your unit tests, and then fails when you try to use it in real code, because you forgot to test it with a type that has a destructor.

No, the lifetime is the same if there is no destructor. Being counter intuitive is poor usability.

If you want to help library authors you issue a warning for generic code only.

  • DIP1000 Ola Fosheim Grøstad via Digitalmars-d-learn
    • Re: DIP1000 ag0aep6g via Digitalmars-d-learn
      • Re: DIP1000 Ola Fosheim Grøstad via Digitalmars-d-learn
        • Re: DIP1000 ag0aep6g via Digitalmars-d-learn
          • Re: DIP1000 Ola Fosheim Grøstad via Digitalmars-d-learn
          • Re: DIP1000 Ola Fosheim Grøstad via Digitalmars-d-learn
            • Re: DIP... Paul Backus via Digitalmars-d-learn
              • Re:... Ola Fosheim Grøstad via Digitalmars-d-learn
                • ... Dukc via Digitalmars-d-learn
                • ... Ola Fosheim Grøstad via Digitalmars-d-learn
    • Re: DIP1000 Loara via Digitalmars-d-learn
      • Re: DIP1000 Ola Fosheim Grøstad via Digitalmars-d-learn
        • Re: DIP1000 Loara via Digitalmars-d-learn
          • Re: DIP1000 Ola Fosheim Grøstad via Digitalmars-d-learn
            • Re: DIP... bauss via Digitalmars-d-learn
              • Re:... Ola Fosheim Grøstad via Digitalmars-d-learn
            • Re: DIP... Loara via Digitalmars-d-learn
              • Re:... Ola Fosheim Grøstad via Digitalmars-d-learn

Reply via email to