Changes between Version 1 and Version 2 of InterfaceTemplateExample
- Timestamp:
- 11/06/06 22:29:02 (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
InterfaceTemplateExample
v1 v2 2 2 3 3 ''Part of'' TemplatesCategory 4 4 5 5 6 == Description == 7 8 Shows how to use an interface template 8 9 10 9 11 == Example == 10 12 11 It wasn't mentioned in the docs, but I had a slight inkling that it might be the case that one could have !InterfaceTemplates using the same syntax as !ClassTemplates (ie class ClassName(T) : [superclass [, interfaces] ). The following example compiled and ran correctly, outputting "1\n4\n" as expected. Perhaps this warrants a mention in the documentation under Templates, alongside "Class Templates"?13 It wasn't mentioned in the docs, but I had a slight inkling that it might be the case that one could have !InterfaceTemplates using the same syntax as !ClassTemplates (ie class ClassName(T) : ![superclass [, interfaces] ). The following example compiled and ran correctly, outputting "1\n4\n" as expected. Perhaps this warrants a mention in the documentation under Templates, alongside "Class Templates"? 12 14 13 15 {{{ 41 43 }}} 42 44 45 43 46 == Source == 44 47 45 [http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/3828 digitalmars.D:3828] 46 47 || Link || http://www.dsource.org/tutorials/index.php?show_example=99 || 48 || Posted by || jcc7 || 49 || Date/Time || Mon Jun 21, 2004 9:20 pm || 48 From [http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D&artnum=3828 digitalmars.D:3828].