On Thu, 14 Oct 2010 09:45:38 +0900, Andrei Alexandrescu <[email protected]> wrote:


About the ongoing discussion about Base64: I do see a few problems with the current interface, although not a major one.

1. The template parameters '!' and '/' are not justified. They should be runtime parameters. Rule of thumb: use generic code when you stand to profit.

I don't understand this point.
Please tell me the merit of runtime parameters.
I can't imagine such situations.

2. This function:

size_t encode(Range)(in ubyte[] source, Range range);

has one issue: (a) it forces input to an array although it could work with any input range with length of ubyte. Suggestion:

size_t encode(R1, R2)(R1 source, R2 target);

Constrain the template any way you need that keeps implementation efficient. Ideally you should have roughly the same performance with a ubyte[] as before.

3. Same discussion about decode. This is actually more important because you might want to decode streams of dchar. This is how many streams will come through, even though they are technically Ascii.

http://lists.puremagic.com/pipermail/phobos/2010-October/002920.html

I already mentioned such encode / decode but no response.
So I suspend the implementation of these functions.
OK, I will implement.
_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos

Reply via email to