- Notifications
You must be signed in to change notification settings - Fork 286
Open
Description
The Parser.ParseArguments() overloads with a factory function has this signature:
public ParserResult<T> ParseArguments<T>(Func<T> factory, IEnumerable<string> args) where T : new() If I provide my own factory function, why does T need to have a public parameterless constructor (new())?
var result = parser.ParseArguments<Options>(() => new Options(true), args); And on the other hand, why doesn't the non-factory overload of ParseArgumentsnot require a public parameterless constructor? This will cause a runtime-exception when T doesn't have a public parameterless constructor.
var result = parser.ParseArguments<Options>(args); JeanSebTr
Metadata
Metadata
Assignees
Labels
No labels