Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Convert
- {
- public static T convertFrom <T>(string value)
- {
- return new T(); //Не работает, нужно как-то задать ограничения new(), но как?
- }
- }
- public static T convertFrom <T>(string value) where T : new()
- {
- return new T();
- }
Add Comment
Please, Sign In to add comment