Hello,
I have a function:
string format(string pattern, T...)(T value)
{
   auto writer = appender!string();
writer.formattedWrite!pattern(convertToUnderlyingType(value)); //Tuple!T(value).expand.to!(OriginalType!T)

   return writer.data;
}

The "value" in this function can be any type including "enum". And if it is a "enum" I want to print it's contents not name. So what I need - check if current argument in template pack is enum then convert it in original type. If current argument isn't enum - leave it as is. In my example I showed it with imaginary function "convertToUnderlyingType".
How to implement it in D?

Reply via email to