[Issue 19366] New: Qualify opCast(bool) as const for findSplit, findSplitBefore and findSplitAfter

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 5 15:48:21 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=19366

          Issue ID: 19366
           Summary: Qualify opCast(bool) as const for findSplit,
                    findSplitBefore and findSplitAfter
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: n8sh.secondary at hotmail.com

Qualify opCast(bool) as const for findSplit, findSplitBefore and
findSplitAfter.

Enables usage
---
if (const split = "a b".findSplit(" ")) {}
---
as a const variant to
---
if (auto split = "a b".findSplit(" ")) {}
---

See also: https://forum.dlang.org/post/rruitwhbxmbsrfsokuet@forum.dlang.org.

Pull request: https://github.com/dlang/phobos/pull/6749

--


More information about the Digitalmars-d-bugs mailing list