template struct ifthenelse; template struct ifthenelse { typedef ThenType type; }; template struct ifthenelse { typedef ElseType type; }; // example usage: select type based on size ifthenelse // otherwise an int will do ::type myvar; // define variable myvar with that type