I want add Yes.keepTerminator flag on lineSplitter.
June 09, 2021 How use lineSplitter with KeepTerminator flag? | ||||
---|---|---|---|---|
| ||||
June 09, 2021 Re: How use lineSplitter with KeepTerminator flag? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marcone | On 6/9/21 2:48 PM, Marcone wrote: > I want add Yes.keepTerminator flag on lineSplitter. It's a template parameter, which is specified after an exclamation mark. The trouble is, Flag is defined in std.typecons. I would expect std.typecons (or at least Flag from it) to be publicly imported but it is not. I think that is an interface bug: If it appears in the interface (of lineSplitter), it should be available without needing to import additional modules. import std.string; import std.stdio; import std.typecons; void main() { auto input = "line1\nline2\nline3"; auto range = input.lineSplitter!(Yes.keepTerminator); writeln(range); } Ali |
Copyright © 1999-2021 by the D Language Foundation