www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - how to tell if a thing is a template

reply "Ellery Newcomer" <ellery-newcomer utulsa.edu> writes:
Can't think off the top of my head how you do this

template IsTemplate(alias t) {
  ??
}

static assert(IsTemplate!IsTemplate)
Aug 23 2014
parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Sunday, 24 August 2014 at 00:41:36 UTC, Ellery Newcomer wrote:
 Can't think off the top of my head how you do this

 template IsTemplate(alias t) {
  ??
 }

 static assert(IsTemplate!IsTemplate)
__traits(compiles, is(t!X, X...)) should do it, or something similar.
Aug 25 2014