[Issue 17188] `core.stdc.stdlib.qsort()` is broken
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Oct 8 13:38:14 UTC 2017
https://issues.dlang.org/show_bug.cgi?id=17188
Rainer Schuetze <r.sagitario at gmx.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |r.sagitario at gmx.de
--- Comment #2 from Rainer Schuetze <r.sagitario at gmx.de> ---
As qsort is @system anyway, the callback does not have to guarantee anything.
To still be able to pass a function with scope parameters, how about
overloading it with both variants:
alias int function(scope const void*, scope const void*) _scope_compare_fp_t;
alias int function(const void*, const void*) _compare_fp_t;
void qsort(scope void* base, size_t nmemb, size_t size, _scope_compare_fp_t
compar);
void qsort(scope void* base, size_t nmemb, size_t size, _compare_fp_t
compar);
--
More information about the Digitalmars-d-bugs
mailing list