[Issue 4265] New: It should be possible to query template parameters with __traits
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Jun 2 20:33:11 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4265
Summary: It should be possible to query template parameters
with __traits
Product: D
Version: future
Platform: Other
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: nfxjfg at gmail.com
--- Comment #0 from nfxjfg at gmail.com 2010-06-02 20:33:10 PDT ---
Consider you have
struct(T1, T2) Foo {
}
alias Foo!(int, float) X;
You should be able to extract (int, float) from X.
Often it is possible to get the parameters indirectly from members, but there
doesn't seem to be a way to do this in the general case.
I suggest:
__traits(getTemplateParameters, X)
which would yield a (int, float) tuple.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list