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

--- Comment #4 from Jon Degenhardt <jrdemail2000-dl...@yahoo.com> ---
(In reply to Duncan Paterson from comment #3)
> Played with this for a while tonight. It seems like the problem is the empty
> function on a lot of ranges not being defined const. I've written a patch
> but I think the knock on of this is quite severe so it's probably not worth
> pushing.

That does make it harder! Perhaps too hard. For example, it might not be
pragmatic to ask that user defined ranges declare 'empty' as const.

Perhaps the better step for now is to simply change the documentation. This
could be done by changing "const" to "auto" in the example:

------------------
if (const split = haystack.findSplit(needle))
{
     doSomethingWithSplit(split);
}
------------------

--

Reply via email to