예제 #1
0
        static void Register <T, TSupport>(bool checks)
            where TSupport : IArithmetic <T>, new()
        {
            InterpFactory <T> interpFactory =
                (s, a, c) => new InterpretImpl <T, TSupport>(s, a, c);

            QuickFactory <T> quickFactory =
                args => new QuickInterpretImpl <T, TSupport>(args);

            if (checks)
            {
                QuickChecked.Add <T>(quickFactory);
                InterpChecked.Add <T>(interpFactory);
            }
            else
            {
                QuickSupport.Add <T>(quickFactory);
                InterpSupport.Add <T>(interpFactory);
            }
        }
예제 #2
0
 static Interpret()
 {
     Normal  = Arithmetics.ResolveInterp <T>(false);
     Checked = Arithmetics.ResolveInterp <T>(true) ?? Normal;
 }