2008-06-01から1ヶ月間の記事一覧

こんなかんじはどうだ

いや、スレッドに別解を並べるのもアレなので。 private static Dictionary<Type, Converter<string, Type>> converters = new (); public static T Parse<T>(string text) { Converter<string, Type> c; if (converters.TryGetValue(typeof(T), out c)) return c(text); throw new NotSupportException(); }</string,></t></type,>…