[Issue 13732] New: Regular templates can use "template this", and they allow any type to be passed
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri Nov 14 00:10:02 PST 2014
https://issues.dlang.org/show_bug.cgi?id=13732
Issue ID: 13732
Summary: Regular templates can use "template this", and they
allow any type to be passed
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: monkeyworks12 at hotmail.com
template Test(this ThisType)
{
pragma(msg, ThisType);
}
void main()
{
alias T = Test!int; // Prints "int"
}
This will also work for class templates, struct templates, alias templates,
enum templates, etc., but not for templated methods. It doesn't matter if the
template is a free template or nested within a struct or class.
--
More information about the Digitalmars-d-bugs
mailing list