Bug 18405 – std.getopt should support std.typecons.Flag out of the box

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-02-09T01:38:21Z
Last change time
2024-12-01T16:32:33Z
Keywords
bootcamp
Assigned to
No Owner
Creator
Seb
Moved to GitHub: phobos#9743 →

Comments

Comment #0 by greensunny12 — 2018-02-09T01:38:21Z
I know that the following works already: --- import std.getopt, std.typecons, std.stdio; void main() { auto args = ["foo", "-u"]; alias U =Flag!"foo"; U flag = U.no; getopt(args, "u", { flag = U.yes; }, ); flag.writeln; } --- https://run.dlang.io/is/46u8Rx But Flag is such a common type and "built-in" in Phobos, s.t. getopt should really support it.
Comment #1 by robert.schadek — 2024-12-01T16:32:33Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9743 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB