Summary: Base template and template arguments
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos

--- Comment #0 from 2010-12-21 00:23:22 PST ---
Sometimes while I use templates, given a type I want to know what's the
template it comes from. So in code like this:

struct Foo(T) {}
struct Bar(T) {}
void main() {
    alias Foo!int Spam;

I want to know if Spam is an instantiation of Foo or Bar, and sometimes I'd
even like to know the typetuple of arguments that has created Spam (here is

Currently there are some ways to solve this problem (and there's a module in
dsource to find the typetuple of the instantiation template arguments), but I'd
like a simple to use, robust, safe, and standard way in Phobos or in __traits,
because I think this is a common enough need.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to