October 15, 2019 [Issue 20301] New: std.regex.regex doesn't accept a const/immutable array of patterns | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=20301 Issue ID: 20301 Summary: std.regex.regex doesn't accept a const/immutable array of patterns Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: phobos Assignee: nobody@puremagic.com Reporter: petar.p.kirov@gmail.com void main() { import std.regex; const arr1 = ["a", "b"]; auto re1 = regex(arr1); immutable arr2 = ["a", "b"]; auto re2 = regex(arr2); } Fails to compile with: /dlang/dmd-nightly/linux/bin64/../../src/phobos/std/regex/package.d(385): Error: cannot modify const expression pat /dlang/dmd-nightly/linux/bin64/../../src/phobos/std/regex/package.d(388): Error: cannot modify const expression pat ... Fix incoming. -- |
Copyright © 1999-2021 by the D Language Foundation