Skip to content

Commit 6bef41b

Browse files
authored
Updates to Template Comparison page (#3602)
* Constructor templates are supported since 2.027 See resolved Bugzilla issue 2596. * Mixed template & non-template function overloading supported since 2.064 See https://dlang.org/changelog/2.064.html#function-template-overload.
1 parent b69d1c8 commit 6bef41b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

articles/template-comparison.dd

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ T foo(T i)
7777

7878
$(TR
7979
$(TD Constructor Templates)
80-
$(TD No)
80+
$(TD Yes)
8181
$(TD Yes)
8282
)
8383

@@ -675,18 +675,17 @@ class Foo< Bar<T,U> >
675675

676676
$(TR
677677
$(TD Overloading Function Templates with Functions)
678-
$(TD No, but the equivalent can be done with explicitly specialized
679-
templates:
678+
$(TD Yes:
680679
---
681680
void foo(T)(T t) { }
682-
void foo(T:int)(int t) { }
681+
void foo(int i) { }
683682
---
684683
)
685684
$(TD Yes:
686685
$(CPPCODE2
687686
template<class T>
688-
void foo(T i) { }
689-
void foo(int t) { }
687+
void foo(T t) { }
688+
void foo(int i) { }
690689
)
691690
)
692691
)

0 commit comments

Comments
 (0)