summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/compilable/extra-files/c6395.d
blob: 58c76bc08068c5b5bed07ea4cd126c6024e19aa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// https://issues.dlang.org/show_bug.cgi?id=6395

template map(alias fun) {
  auto map(Range)(Range r) {
    struct Result
    {
      @property auto ref front()
      {
        return fun("a");
      }
    }
    return Result();
  }
}

Range find(alias pred, Range)(Range haystack) {
  pred(haystack.front);
  return haystack;
}