how to find the type of a supplied variable

seany seany at uni-bonn.de
Fri Dec 6 12:18:51 PST 2013


I have the following

void functionName(T)(T argumentVar)
{

     /+
     now i want that based on type of argumentVar, things will be 
done
     eg :
     if there is a function gettype; then :
     +/

     switch(argumentVar.gettype)
     {
         case "string array":
              //do something
         case "string":
              //treat srting as a file...
              //then do some other things
     }

}


How do I incorporrate this?


More information about the Digitalmars-d-learn mailing list