Bug 22786 – maxElement et al does not support range over immutable

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2022-02-17T10:21:08Z
Last change time
2023-04-19T23:29:29Z
Keywords
pull
Assigned to
No Owner
Creator
FeepingCreature

Comments

Comment #0 by default_357-line — 2022-02-17T10:21:08Z
import std; void main() { struct S { immutable int value; } assert([S(5), S(6)].maxElement!"a.value" == S(6)); }
Comment #1 by dlang-bot — 2023-01-25T15:26:48Z
@FeepingCreature created dlang/phobos pull request #8669 "Fix issue 22786: maxElement over immutable ranges" fixing this issue: - Fix issue 22786: Add yet another special case to the extremum code, in the hope that at even when the elements are immutable, at least the ranges will be assignable. https://github.com/dlang/phobos/pull/8669
Comment #2 by dlang-bot — 2023-04-18T09:09:55Z
@FeepingCreature created dlang/phobos pull request #8734 "Fix issue 22786 (immutable element in maxElement) by always using Rebindable." fixing this issue: - Fix issue 22786 (immutable element in maxElement) by always using Rebindable. https://github.com/dlang/phobos/pull/8734
Comment #3 by dlang-bot — 2023-04-19T23:29:29Z
dlang/phobos pull request #8734 "Fix issue 22786 (immutable element in maxElement) by always using Rebindable." was merged into master: - b818901e6351d8fb8ef75cba11df3278a0a25bcf by Mathis Beer: Fix issue 22786 (immutable element in maxElement) by always using Rebindable. https://github.com/dlang/phobos/pull/8734