February 19, 2013 Make struct transparent to std.algorithm.sort | ||||
|---|---|---|---|---|
| ||||
Is there a way to make this sort of thing work?
import std.algorithm;
struct S
{
int[] arr;
alias arr this;
}
void main()
{
auto s = S([1,2,3]);
sort(s); // error: template std.algorithm.sort does not match any function
// template declaration. Candidates are...
}
| ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply