On Friday, 3 October 2014 at 19:31:30 UTC, monarch_dodra wrote:
The idea is to try to keep as much code in common as possible. You can keep your version, provided you write this for popFront:

    void popFront()
    {
        if (_index < _data.length)
        {
            static if (isNarrowString!R)
                _index += stride(_data, _index)
            else
                ++_index;
        }
    }

Superb!

Is prefix ++ preferred in D because of some specific reason? I recall it, for some containers/iterators, gives smaller/faster codegen in C++?

You could perfectly well support infinite ranges, with the correct static ifs. You'd produce an infinite sliding splitter.

That's for episode 3 ;)

Reply via email to