div0 wrote:

It seems I might know how to do this after all.

As is mentioned under template constraints[1], templates can be specialized by 
trailing the parameter list with a condition:

template createHandlerCode( T... ) if ( T[0]._type == 
EHandlerType.eMsgRangeHdlr ) {
 string format( ) {
   return createMessageRangeHandler!( T ).format();
 }
}
template createHandlerCode( T... ) if ( T[0]._type == EHandlerType.eMsgHdlr ) {
 string format( ) {
   return createMessageHandler!( T ).format();
 }
}
template createHandlerCode( T... ) if ( T[0]._type == EHandlerType.eCmdIdHdlr ) 
{
 string format( ) {
   return createCommandIdHandler!( T ).format();
 }
}

This code is D2-only and untested, so there is certainly a possibility it will 
not work for you.

[1]: http://www.digitalmars.com/d/2.0/template.html#Constraint

--
 Simen

Reply via email to