Implicit template properties
Edward Diener
eddielee_no_spam_here at tropicsoft.com
Sun Apr 13 05:26:39 PDT 2008
Edward Diener wrote:
> In the documentation on templates I read:
>
> "Implicit Template Properties
> If a template has exactly one member in it, and the name of that member
> is the same as the template name, that member is assumed to be referred
> to in a template instantiation:
> template Foo(T)
> {
> T Foo; // declare variable Foo of type T
> }
> void test()
> {
> Foo!(int) = 6; // instead of Foo!(int).Foo
> }"
>
> What practical benefit does it serve having a template with a single
> member which has the same name as the template itself ? It does not
> appear that one can do anything with such a template.
Never mind ! I see the reason for it.
More information about the Digitalmars-d
mailing list