Ejemplo n.º 1
0
 public T Get <T>()
 {
     if (Type == typeof(bool))
     {
         return(UnaryOp <bool> .Cast <T>(v_bool));
     }
     else if (Type == typeof(byte))
     {
         return(UnaryOp <byte> .Cast <T>(v_byte));
     }
     else if (Type == typeof(char))
     {
         return(UnaryOp <byte> .Cast <T>(v_byte));
     }
     else if (Type == typeof(sbyte))
     {
         return(UnaryOp <sbyte> .Cast <T>(v_sbyte));
     }
     else if (Type == typeof(short))
     {
         return(UnaryOp <short> .Cast <T>(v_short));
     }
     else if (Type == typeof(ushort))
     {
         return(UnaryOp <ushort> .Cast <T>(v_ushort));
     }
     else if (Type == typeof(int))
     {
         return(UnaryOp <int> .Cast <T>(v_int));
     }
     else if (Type == typeof(uint))
     {
         return(UnaryOp <uint> .Cast <T>(v_uint));
     }
     else if (Type == typeof(float))
     {
         return(UnaryOp <float> .Cast <T>(v_float));
     }
     else
     {
         return(default);
Ejemplo n.º 2
0
 private static TOut Cast <TIn, TOut>(TIn value, Type type)
 {
     return(UnaryOp <TIn> .CastIntermediate <TOut>(value, type));
 }