Bug 11123 – std.getopt should support functions

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-09-25T06:12:00Z
Last change time
2013-09-27T08:06:10Z
Keywords
pull
Assigned to
andrej.mitrovich
Creator
andrej.mitrovich

Comments

Comment #0 by andrej.mitrovich — 2013-09-25T06:12:16Z
Currently getopt works with delegates, but not functions: ----- import std.getopt; void main(string[] args) { static void test1(string) { } void test2(string) { } getopt(args, "test1", &test1, // fails "test2", &test2); } ----- AFAICT I don't see any technical reason why functions shouldn't be supported.
Comment #1 by andrej.mitrovich — 2013-09-25T17:07:09Z
Comment #2 by github-bugzilla — 2013-09-27T08:02:07Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/83852de6c12c3f05f5f5980861c3a46ad780ab6f Fixes Issue 11123 - std.getopt should support function callbacks. https://github.com/D-Programming-Language/phobos/commit/1ceddc4f823fbdfa79a5024302fb7d405de887bb Merge pull request #1601 from AndrejMitrovic/Fix11123 Issue 11123 - std.getopt should support function callbacks.