File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -658,8 +658,10 @@ $(H2 $(GNAME getOverloads))
658
658
659
659
$(P The first argument is an aggregate (e.g. struct/class/module).
660
660
The second argument is a string that matches the name of
661
- one of the functions in that aggregate.
661
+ one of the members in that aggregate.
662
+ The third argument is a bool, and is optional.
662
663
The result is a tuple of all the overloads of that function.
664
+ If the third member evaluates to true, the result will include all members that matches the supplied name.
663
665
)
664
666
665
667
---
@@ -671,6 +673,8 @@ class D
671
673
~this() { }
672
674
void foo() { }
673
675
int foo(int) { return 2; }
676
+ void bar(T)() { return T.init; }
677
+ class bar(int n) {}
674
678
}
675
679
676
680
void main()
@@ -686,6 +690,9 @@ void main()
686
690
687
691
auto i = __traits(getOverloads, d, "foo")[1](1);
688
692
writeln(i);
693
+
694
+ foreach (t; __traits(getOverloads, D, "bar", true))
695
+ writeln(t.stringof);
689
696
}
690
697
---
691
698
@@ -697,6 +704,8 @@ int()
697
704
void()
698
705
int()
699
706
2
707
+ bar(T)()
708
+ bar(int n)
700
709
)
701
710
702
711
$(H2 $(GNAME getParameterStorageClasses))
You can’t perform that action at this time.
0 commit comments