diff options
Diffstat (limited to 'libphobos/src/std/algorithm')
-rw-r--r-- | libphobos/src/std/algorithm/searching.d | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libphobos/src/std/algorithm/searching.d b/libphobos/src/std/algorithm/searching.d index f061915..37a08de 100644 --- a/libphobos/src/std/algorithm/searching.d +++ b/libphobos/src/std/algorithm/searching.d @@ -1528,6 +1528,23 @@ if (isInputRange!Range && !isInfinite!Range && assert([S(5), S(6)].extremum!"a.value" == S(5)); } +// https://issues.dlang.org/show_bug.cgi?id=24027 +@safe nothrow unittest +{ + class A + { + int a; + this(int a) + { + this.a = a; + } + } + + auto test = new A(5); + A[] arr = [test]; + assert(maxElement!"a.a"(arr) is test); +} + // find /** Finds an individual element in an $(REF_ALTTEXT input range, isInputRange, std,range,primitives). |