title: Converting value of type <T> into Variant, is it possible?
body: <p>here is a snippet showing what I am trying to achieve:</p>
  
  <pre><code>type
    TMyObject&lt;T&gt; = class (TObject)
      function GetVarType(Value: T): TVarType;
    end;
  
  
  function TMyObject&lt;T&gt;.GetVarType(Value: T): TVarType;
  var
    TmpValue: Variant;
  begin
    TmpValue := Variant(Value); //Invalid typecast
    Result := VarType(TmpValue);
  end;
  </code></pre>
  
  <p>I know that above apporach with typecast is naive but I hope you get the idea. I would like to replace it with some conversion mechanism.</p>
  
  <p>TMyObject will be always of simple type like Integer, String, Single, Double.</p>
  
  <p>The purpose of such conversion is that function VarType gives me integer constant for each simple type which I can store somewhere else. </p>
  
  <p>I would like to know if such conversion is possible?</p>
  
  <p>Thanks for your time.</p>