On Wednesday, 24 June 2015 at 01:04:01 UTC, Adam D. Ruppe wrote:
We disagreed on this on irc, but I ask you to consider the following which limits the code breakage a lot more than my first proposal in chat:

[...]

Some thoughts:

- I think the implementation is better done through composition (i.e. a function that takes any range, and returns a type that works like that range but also allows implicit conversion to string. Not sure how feasible this is, maybe multiple alias this will help.

- On the performance side, one point is that this grows the size of the struct by two machine words (string's .ptr and .length). This type is likely to be passed by value through function parameters, too.

- Another perf. issue is that this introduces additional cost every time the implicit conversion to string is done (you need to at least check if the string value has been calculated).

Ultimately I think it's interesting but I defer the final answer to Walter/Andrei, and I think I can predict their answer.

Reply via email to