Major performance problem with std.array.front()

Walter Bright newshound2 at digitalmars.com
Thu Mar 6 19:52:44 PST 2014


On 3/6/2014 7:06 PM, Walter Bright wrote:
> On 3/6/2014 6:37 PM, Walter Bright wrote:
>> Is there any hope of fixing this?
>
> Is there any way we can provide an upgrade path for this? Silent breakage is
> terrible. Any ideas?

Ok, I have a plan. Each step will be separated by at least one version:

1. implement decode() as an algorithm for string types, so one can write:

     string s;
     s.decode.algorithm...

suggest that people start doing that instead of:

     s.algorithm...

2. Emit warning when people use std.array.front(s) with strings.

3. Deprecate std.array.front for strings.

4. Error for std.array.front for strings.

5. Implement new std.array.front for strings that doesn't decode.


More information about the Digitalmars-d mailing list