div0 wrote:

Thanks Simen,

That's nicer than the chained static ifs.
Is there anyway to get rid of the enum though?

I would believe this to work:


template createHandlerCode( T... ) if ( is( T == msgRangeHdlr ) ) {
        string format( ) {
                return createMessageRangeHandler!(T).format();
        }
}
template createHandlerCode( T... ) if ( is( T == msgHdlr ) ) {
        string format( ) {
                return createMessageHandler!(T).format();
        }
}
template createHandlerCode( T... ) if ( is( T == cmdIdHdlr ) ) {
        string format( ) {
                return createCommandIdHandler!(T).format();
        }
}

--
 Simen

Reply via email to