title: How could I cast a type stored in a string to a type at runtime on dlang?
body: <p>I want to deserialize a variable and for that I have stored its type in a string just like this:</p>
  
  <pre><code>int var = 60;
  auto type = typeid(int).toString;
  writeln(type); //Prints "int"
  </code></pre>
  
  <p>But now, when I have to deserialize it, I can not just cast the string to a real type as it is required to do it at compile time. I could make a table and store alias to types or build a big switch block for every type, but it will eventually get really annoying. Does anyone have any suggestion?</p>