Re: Finding out if T is a specialization of another template

2011-02-18 Thread Lars T. Kyllingstad
On Fri, 18 Feb 2011 20:37:38 +, Sean Eskapp wrote: > == Quote from Lars T. Kyllingstad (public@kyllingen.NOSPAMnet)'s article >> On Fri, 18 Feb 2011 17:16:02 +, Sean Eskapp wrote: >> > I was given this code, to check if Y is a specialization of Bar. How >> > does it work? >> > >> > class B

Re: Finding out if T is a specialization of another template

2011-02-18 Thread Sean Eskapp
== Quote from Lars T. Kyllingstad (public@kyllingen.NOSPAMnet)'s article > On Fri, 18 Feb 2011 17:16:02 +, Sean Eskapp wrote: > > I was given this code, to check if Y is a specialization of Bar. How > > does it work? > > > > class Bar(T) > > { > > } > > > > void foo(Y)() > > { > > static if

Re: Finding out if T is a specialization of another template

2011-02-18 Thread Lars T. Kyllingstad
On Fri, 18 Feb 2011 17:16:02 +, Sean Eskapp wrote: > I was given this code, to check if Y is a specialization of Bar. How > does it work? > > class Bar(T) > { > } > > void foo(Y)() > { > static if (is(Y Z == Bar!Z)) > { > // Here, Z is now an alias to whichever type Bar is //

Finding out if T is a specialization of another template

2011-02-18 Thread Sean Eskapp
I was given this code, to check if Y is a specialization of Bar. How does it work? class Bar(T) { } void foo(Y)() { static if (is(Y Z == Bar!Z)) { // Here, Z is now an alias to whichever type Bar is // instantiated with. } else { // Z is invalid here.